If you really need that (in most cases you don't) then you have to copy the
CString
content.
(For simplicity I assume you have a
ANSI
CString
, not a wide character one)
const int SIZE = 256;
char name[SIZE];
strncpy(name, testCStr, SIZE-1);
name[SIZE] = '\0';