If you wish to open a file for reading. You could code the following:
FILE * myfileptr; // a pointer declared to the file stream.
char sc; // a character which will be input from the file.
// main code...
myfileptr=fopen("fileiotst.c","r"); //open the file hopefully
while((sc=getc(myfileptr))!=EOF) //get a char
if(sc)printf("%c",sc); //dump it to screen
Note: this procedure reads from the file character by character... if you wanted to read into a string variable you could build up a string from the characters, halting the build on the line end.
Or, if you knew the format of the file (ideally because you built it) you could use fscanf to read in the data. fscanf is the cousin of scanf which we are all familiar with.