To read from file what we require ?-A file pointer.
-fopen() function to open file in read mode.
-fgetc() to read character by character from file.
-fclose() to close the file.
Open file in read mode:Syntax-
//open file in read mode
//Now read file character by character
printf("Your file data is\nn");
fclose(fp);// close file
printf("Your file is safely closed now");
Your file data is
This is my data i store inside my file
Your file is safely closed now.