|
-
March 8th, 2004, 06:21 AM
#1
Getting a CString into a char ...
Hi
How can i make my CString "A" fit into a char variable ?
P
-
March 8th, 2004, 06:45 AM
#2
char* arr;
arr = myCString.GetString();
this converts the cstring to a char array ...
-
March 8th, 2004, 06:46 AM
#3
-
March 8th, 2004, 07:19 AM
#4
Nope but you should use the .GetBuffer()
that is what i think they ment ...
Thanks anyway
P
-
March 8th, 2004, 07:19 AM
#5
Re: Getting a CString into a char ...
Originally posted by posty68
How can i make my CString "A" fit into a char variable ?
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...
-
March 8th, 2004, 07:19 AM
#6
Originally posted by NoHero
char* arr;
arr = myCString.GetString();
this converts the cstring to a char array ...
There is no such function 'GetString()' for the class 'CString'...
-
March 8th, 2004, 07:39 AM
#7
-
March 8th, 2004, 07:58 AM
#8
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.
-
March 8th, 2004, 08:16 AM
#9
[I]Originally quoted by Andreas Masur
There is no such function 'GetString()' for the class 'CString'...
Actually, in VC.Net, CString (which is a CSimpleStringT) does have GetString function.
TDM
-
March 8th, 2004, 08:42 AM
#10
Originally posted by TDM
Actually, in VC.Net, CString (which is a CSimpleStringT) does have GetString function.
Okay...didn't think of that one...thanks for pointing out...
-
March 8th, 2004, 09:36 AM
#11
oh sry i forgot, GetString() is only available at dotNET ...
ng
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|