delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/08/21:36:36

From: "Morpheus" <hall AT silo DOT csci DOT unt DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: syntax thing
Date: Mon, 8 Nov 1999 18:22:03 -0600
Organization: Zion
Lines: 35
Message-ID: <807pfc$sj9@hermes.acs.unt.edu>
NNTP-Posting-Host: dfw-premium-17.dialup.unt.edu
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I'm getting the following error message:

FileUtils.cpp:15: no matching function for call to `ifstream::readLine (char
*&, int, char)'

FileUtils.cpp:19: no matching function for call to `ifstream::getLine (char
*&, int)'

for the following code:

#define MAX_LINE 255
...
char* line = new char[MAX_LINE + 1];
ifstream in(someFile);
int numLines = 0;
in.readLine(line, MAX_LINE, '\n'); file://line 15

while(in) {
numLines++;
in.getLine(line, MAX_LINE); file://line 19
}
...

I've tried changing the declaration of line to:
char line[MAX_LINE + 1];

but it gives me the same error with "char[256]" instead of "char *".

morpheus
hall AT cs DOT unt DOT edu
http://people.unt.edu/~dahall

"How do the machines know what Tasty Wheat tasted like?"


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019