Conversion of CString to string VC++/C++

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

calculus87

Thread Starter
Joined
Sep 4, 2003
Messages
34
Hello,
Here is my question. I have a program which has a VC++ frontend. While the VC++ program is running it calls a C++ program in the background. The C++ program returns a string. Now I need to save that string. But the only way I know how(which does not work) is through CString. So my question is this, is there any way so save the returned string? Thanks for taking a look.
Sincerely,
Ronald
 

Anne Troy

Anne
Joined
Feb 14, 1999
Messages
11,746
Hi, Calc. I moved your Q to Development, which is where most programming answers can be gotten.

:)
 

Guy

Joined
Feb 19, 1999
Messages
260
Did you want a conversion from CString to string? or string to CString?

here is string to CString:
Code:
string s = "hello string";
CString c = s.c_str();
here is CString to string:
Code:
CString c = "hello CString";
string s = c;
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top