×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

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

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

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

(OP)
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...

thanks,

Ken Wong.

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

KenWong,

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,

ofstream ProdFile;
ProdFile.open("AFile.Txt", ios::out);
AnsiString thingy = "something";
ProdFile << thingy.c_str() << endl; // streams can't use AnsiString
ProdFile.close();

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.

James P. Cottingham
main@ivcusa.com
International Veneer Co., Inc.
All opinions are mine alone and do not necessarily reflect those of my employer.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close