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 

write help

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





PostPosted: Thu Aug 18, 2005 5:18 am    Post subject: write help Reply with quote



I need a version of the write( ) function that I can use with an AnsiString.
I am writing to a text file.

Like this, write( AnsiString );

Does that exist.

Thanks


Back to top
LarryJ
Guest





PostPosted: Thu Aug 18, 2005 6:55 am    Post subject: Re: write help Reply with quote



I figured this out by using AnsiString .c_str()


"LarryJ" <LarryJ33 (AT) ev1 (DOT) net> wrote

Quote:
I need a version of the write( ) function that I can use with an
AnsiString. I am writing to a text file.

Like this, write( AnsiString );

Does that exist.

Thanks





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Aug 18, 2005 7:06 am    Post subject: Re: write help Reply with quote




"LarryJ" <LarryJ33 (AT) ev1 (DOT) net> wrote


Quote:
I need a version of the write( ) function that I can use with
an AnsiString. I am writing to a text file.

Like this, write( AnsiString );

You don't need it. Simply use the AnsiString's c_str() method to get a
pointer to the raw char* data and then write() it directly:


AnsiString s = "whatever";
write(iFile, s.c_str(), s.Length());


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language C++) 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.