September 25th, 2003, 01:13 PM
CString to string
here is my question. I am new to VC++, but not C++.
I would like to pass a variable of type CString (VC++) to a string in (C++).
I currently am saving the variable of type CString in a file. Then in my C++ code open the file and read it out as type string.
Is there just some short conversion.
could you do this? If not then what?
Thanks for the help,
(oh, by the way, how do you put your pic in the site?)
This message is a natural product made from recycled electrons. The slight
variations in spelling and grammar enhance its individual character and
beauty and in no way are to be considered flaws or defects.
September 25th, 2003, 01:45 PM
Here is some background to CString: http://msdn.microsoft.com/library/de...fc_cstring.asp.
Here is some code:
Dunno nutin about the pics.
using namespace std;
cstr = "this is a CString";
str = "this is a string";
printf("%s\n%s\n", cstr, str.c_str());
cstr = "This is a str stuffed into a CString: ";
cstr += str.c_str();
September 25th, 2003, 02:58 PM
Thanks, I will play around with this for a bit