Name: Anonymous 2010-12-14 20:17
Can you guys PLEASE show me a very, very basic C program that writes input to a text file?
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int c;
while ((c = getchar()) != EOF) putchar(c);
return ferror(stdin) || ferror(stdout) ? EXIT_FAILURE : 0;
}stdin to stdout. Redirecting stdout to a file is a job best left to the shell (if you don't know what this means, Google shell redirection).