Need help in reading from file.
Posted on 2003-11-13
I have to read the contents of a text file into a char* variable. I am using visual c++ 6.0 and following is the code snippet-
static char* readFromFile(const char* fname)
if( (stream = fopen( fname, "r+t" )) != NULL )
/* Attempt to read */
fread( list, sizeof( char ), 100000, stream );
fclose( stream );
But the fopen fails here. When I tried to debug, it asks me the path of fopen.c.
What am I missing here?