//Opens a file named "hello.txt" and reads each byte from the file //and prints it to stdout //The program closes the file at the end #include #include #include #include int main(void){ FILE *in = fopen("hello.txt", "r"); if (in == NULL) { perror("hello.txt"); return 1; } int ch; while ((ch = fgetc(in)) != EOF) fputc(ch,stdout); //Could just use putchar(ch); fclose(in); return 0; }