|
-
Oct 24th, 2002, 05:54 AM
#1
Thread Starter
Lively Member
getline with fstream
std::string CFile::GetLine()
{
std::string line;
std::getline(this->file, line, '/n'); // Error is here
}
I cannot get the above to work, any ideas why?
this->file is an fstream.
From the looks of the debug, it looks like getline won't accept an fstream?
huge thanks
-
Oct 24th, 2002, 07:57 AM
#2
Monday Morning Lunatic
It's that '/n'. You need to use '\n'. Or better still, just leave it out. It knows to look for a newline.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Oct 24th, 2002, 08:02 AM
#3
Thread Starter
Lively Member
-
Apr 2nd, 2006, 05:01 PM
#4
Lively Member
Re: getline with fstream
how do i stop the getline from returning /n ?
any help would be cool 
regards
John
-
Apr 3rd, 2006, 12:17 PM
#5
Re: getline with fstream
Please, don't reply to 4 year old threads, start a new one!
Getline does not return the \n in it's output, assuming '\n' is the delimter used for getline:
If the delimiter is found, it is extracted but not stored.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|