#include #include int main() { char * filename = "C:/users/athitsos/temp/hello.txt"; // open a file for reading. FILE * file2 = fopen(filename, "r"); if (file2 == 0) { printf("failed to open file %s for reading\n", filename); return 0; } char * buffer = (char *) malloc(sizeof(char) * 1000); while(1) { // read a word from the file. int items = fscanf(file2, "%s", buffer); // if no word was read, exit the while loop. if (items <= 0) { break; } // print the word that was fread from the file. printf("%s ", buffer); } // close the file. fclose(file2); }