Mail Archives: djgpp/1999/11/08/16:00:48
At 11:35 08/11/99 -0600, "Morpheus" wrote:
>Here is the code:
>
>int getFileNumLines(char* file) {
> ifstream in(file);
> if(!in) {
> return 0;
> }
> char* line = new char[MAX_CHARS + 1]; // parse error here
> int numLines = 0;
> in.readLine(line, MAX_CHARS); // parse error here
>
> while(in) {
> numLines++;
> in.readLine(line, MAX_CHARS); // parse error here
> }
>
> freeString(line);
> in.close();
> return numLines;
>}
>
>I get a parse error on the lines indicated. MAX_CHARS is defined in another
>.h file, which is included. Thanks for help on this menial problem.
>
Humm. . . the problem description leads to the conclusion something is
wrong with the macro MAX_CHARS definition.
Get a look at it, or if still stuck post the line in the header where it is
defined.
- Raw text -