/** * file_io.c * * Andi Peng * Section, Week 4 * * Writes "Hello, World" to a file using File I/O */ #include int main(void) { // create a reference to the file FILE* hello = fopen("hello.txt", "w"); // check to make sure file is not NULL if (hello == NULL) { return 1; } // write "Hello, World!" to the file fprintf(hello, "Hello, world!"); // close the file fclose(hello); }