|
-
Jan 2nd, 2002, 08:01 PM
#1
Thread Starter
New Member
char [30] = CString? How do I do it?
I have a char array of 30. How do I convert a CString so I can assign the values to the array? Thanks.
-
Jan 2nd, 2002, 09:44 PM
#2
Thread Starter
New Member
Ah. nevermind found it again.
Code:
strcpy(MyCharArray,(LPCTSTR) MyCString);
-
Jan 6th, 2002, 11:34 AM
#3
No good way, screws up CString's memory management. Simply do
Code:
char ar[30] = "Helloooooojjjjjhhhhhgggggffff";
CString str;
str = ar;
// or
CString str2(ar);
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 6th, 2002, 11:41 AM
#4
Thread Starter
New Member
Thanks, but I was looking for something that will do ar = str. strcpy() seems to do it correctly.
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
|