![]() |
|
#1
|
|||
|
|||
char - CString ??On the Dialog Box, the user enters his/her name in an edit box and I save that name in a dynamically allocated array :
CPP / C++ / C Code:
*(UserName[UserNo]) = m_UserName; Now this last statment gives me an error because UserName is char type and the value I take in the edit box is CString... what do I do ??? Last edited by LuciWiz : 09-May-2008 at 07:13.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|
#2
|
|||
|
|||
Re: char - CString ??With char pointers, you can't just set the value of it. You have to use a function like strcpy(). Of course, first, you'll have to convert the CString into a single-byte string type.
|
|
#3
|
|||
|
|||
Re: char - CString ??ya but how do change CString ???
|
|
#4
|
|||
|
|||
Re: char - CString ??Why not make your array an array of CString objects or change them from char* to TCHAR*?
|
|
#5
|
|||
|
|||
Re: char - CString ??hey thanks for the help but the problem got solved just by using strcpy ..didn't have to convert anything into CString or char !!!!!
|
Recent GIDBlog
Python ebook by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Pointer initialization causing program abend? | emanresu | C Programming Language | 0 | 12-Dec-2006 10:36 |
| lvalue compile error | emanresu | C Programming Language | 7 | 16-Nov-2006 10:22 |
| getting an error while compiling and running using different IDE. | jaro | C Programming Language | 0 | 25-Aug-2006 09:14 |
| Memory cannot be read? | dlare9 | C Programming Language | 3 | 16-Nov-2005 07:03 |
| Debug Assertion Failed! | dlare9 | C Programming Language | 3 | 13-Nov-2005 23:18 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The