It looks like it: http://www.cplusplus.com/reference/c...dio/fgets.html It doesn't take long to try it out though. E.g. the following works for me when "myfile.txt is in the same directory as the path for cmd. Otherwise it can't find the program, so when given a relitive path, it serces in the current directory. Try out other things, like putting the file to open in the system root and c if it finds it. Note opening with write access creates the file if non-existant:
Code:
/* fopen example from site above*/
#include <stdio.h>
int main ()
{
FILE * pFile;
char mystring [100];
pFile = fopen ("myfile.txt","r");
if (pFile == NULL) perror ("Error opening file");
else
{
fgets (mystring , 100 , pFile);
puts (mystring);
fclose (pFile);
}
return 0;
}