Hi
How can i make my CString "A" fit into a char variable ?
P
Printable View
Hi
How can i make my CString "A" fit into a char variable ?
P
char* arr;
arr = myCString.GetString();
this converts the cstring to a char array ...
Thanks again
Nope but you should use the .GetBuffer()
that is what i think they ment ...
Thanks anyway
P
Do you want to get the complete string or only a character? For the complete string take a look at the operator 'LPCTSTR', for a character, use the 'GetAt()' function...Quote:
Originally posted by posty68
How can i make my CString "A" fit into a char variable ?
There is no such function 'GetString()' for the class 'CString'...Quote:
Originally posted by NoHero
char* arr;
arr = myCString.GetString();
this converts the cstring to a char array ...
A char variable holds a single byte. You can't make a CString "fit" in a char. As asked, the question doesn't really make sense.
Actually, in VC.Net, CString (which is a CSimpleStringT) does have GetString function.Quote:
[I]Originally quoted by Andreas Masur
There is no such function 'GetString()' for the class 'CString'...
TDM
Okay...didn't think of that one...thanks for pointing out... :cool:Quote:
Originally posted by TDM
Actually, in VC.Net, CString (which is a CSimpleStringT) does have GetString function.
oh sry i forgot, GetString() is only available at dotNET ...
ng