c++ File input/output
- by Myx
Hi:
I am trying to read from a file using fgets and sscanf. In my file, I have characters on each line of the while which I wish to put into a vector. So far, I have the following:
FILE *fp;
fp = fopen(filename, "r");
if(!fp)
{
fprintf(stderr, "Unable to open file %s\n", filename);
return 0;
}
// Read file
int line_count = 0;
…