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!

I really need some simply code to convert an AnsiString to a *char...

Status
Not open for further replies.

KenWong

Programmer
Mar 16, 2000
1
GB
Im Stuck, I've been writing this little program for windows and I'm at a loss - If you can tell me in PLAIN ENGLISH with some good source code, how to make this conversion I'll give you a copy of this program when it's done, I know the the class Ansistring has a method called c_str that gives back the AnsiString as Null terminated c-string but I don't know how to use methods in Classes!!, whats the Syntax !! help...<br>

<br>

thanks,<br>

<br>

Ken Wong.
 
KenWong,<br>
<br>
I admit, I'm dense, I'm not certain what you mean. I use .c-str() alot in classes. I haven't had a problem with it. For example,<br>
<br>
ofstream ProdFile;<br>
ProdFile.open(&quot;AFile.Txt&quot;, ios::eek:ut);<br>
AnsiString thingy = &quot;something&quot;;<br>
ProdFile &lt;&lt; thingy.c_str() &lt;&lt; endl; // streams can't use AnsiString<br>
ProdFile.close();<br>
<br>
Are you trying to create a class that passes a string? Are you having problems with methods in general? Are you looking for the specific syntax for c_str? Let us (me) know some more specifics and we'll (I'll) see what can be done.<br>
<br>
<p>James P. Cottingham<br><a href=mailto:main@ivcusa.com>main@ivcusa.com</a><br><a href= Veneer Co., Inc.</a><br>All opinions are mine alone and do not necessarily reflect those of my employer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top