Now look in your computer and find the file and open it.
char myString="This is sample data.";
fscanf(stdin, "%s" , myString);
/// "stdin" is the keyboard *stream* ///
FILE *file_ptr; //declare a pointer to a new struct of "FILE" type
file_ptr = fopen("c://myData.txt", "w+");
fprintf(file_ptr, "%s", myString);
fclose(file_ptr); //NEVER FORGET TO DO THIS!!
Check to see if it performed properly.
Better yet, now use fscanf() with file_ptr as the *stream* and print the files contents to your screen using fprintf with "stdout" as the *stream*.
///"stdout" is your computers screen *stream*