BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Null Character

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language)
View previous topic :: View next topic  
Author Message
Vijay
Guest





PostPosted: Thu Dec 16, 2004 9:47 pm    Post subject: Null Character Reply with quote



Hello,
I have been writing list<string> to a file using the following code:

bool save_to_file(
std::string const & filename,
std::list<std::string> & list)
{
std::ofstream strm(filename.c_str());
if (!strm)
{
return false;
}
copy(list.begin(), list.end(), ostream_iterator<std::string>(strm,
"n"));
return strm.eof();
}

Until recently this was working fine, but now, all of a sudden, it
started giving me "null character" in the output along with the end of
line. I haven't changed my code, can you please send me your thoughts
on what is going wrong. I would also greatly appreciate if you can
send me any alternate method for writing a list of strings to a file.

I am using C++ Builder 5.0 ( Build 12.34) on Windows 2000.
Thanks,

Vijay

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.