Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i convert an AnsiString to a basic_string

Status
Not open for further replies.

holdingprice

Programmer
Apr 8, 2003
5
GB
I am writting the contents of edit boxes to a text file but can not convert the contents of the edit box(an ansiString) to a basic_string. I need to do this to use the cout statement with the ofstream.

Anyone got any ideas, they are a great help!
 
sorry i meant to say &quot;I need do this to use the << opperator with the ofstream&quot; not &quot;cout statement&quot;
 
Use
Code:
MyStream << MyAnsiString.c_str();
or
Code:
std::string MyStdStr = MyAnsiString.c_str();
MyStream << MyStdStr;
James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top