Re: [Dev-C++] access violation, error in code ?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Carlos d. M. <cg...@wo...> - 2002-07-26 11:47:34
|
The function is getline(buffer, number of chars);
You have getline(variable I don't see where it comes from, string), but t=
hen it
should say implicit declaration of function, expected getline(char*,int)
Did you overloaded it? If so, the error shall be inthe overloading code.
In bastring is a definition of getline (istream&, basic_string <charT, tr=
aits,
Allocator>&, charT delim =3D '\n'); but this has three parameters.
h.r...@gm... escribi=F3:
> Hi all,
>
> I always get a access violation ( access at 0x00000000) at the first ge=
tline
> command in the following codesnip. Has someone a explanition for this=
?
> Thanks in advance.
>
> greetings
> Horst
>
> codesnip:
> [...]
> bool isLine2Skip(const string& s) {
> return ( (s[0] =3D=3D ';') || // Comment
> (s[0] =3D=3D ' ') || // Space
> s.empty() ); // Empty String
> } // bool isLine2Skip
>
> bool ReadDataFile(const string& s)
> {
> try {
> ifstream in(s.c_str());
> if (!in) throw ERR_FILE_OPEN;
>
> string line;
>
> do {
> getline(in, line);
> } while (isLine2Skip(line));
> pf.MeanS =3D atof(line.c_str());
>
> [...]
>
> --
> Horst R=F6=DFner
> Postf. 1802
> 52205 Stolberg
>
> ICQ ID #74808448
> h.r...@gm...
> h.g...@t-...
>
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net
>
> -------------------------------------------------------
> This sf.net email is sponsored by: Jabber - The world's fastest growing
> real-time communications platform! Don't just IM. Build it in!
> http://www.jabber.com/osdn/xim
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|