Concatenate char to String

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Okay I know this is basic C++ but can someone tell me how to concatenate
char[] to string.
Ex:
char hexChar[]={'A','B','C','D','E','F'};
String *str ="A";

how can I do this:
str = hexChar[1] + hexChar[3]; or str = str + hexChar[3];

thanx,
Poe
 
Okay I know this is basic C++ but can someone tell me how to concatenate
char[] to string.
Ex:
char hexChar[]={'A','B','C','D','E','F'};
String *str ="A";

how can I do this:
str = hexChar[1] + hexChar[3]; or str = str + hexChar[3];

If you're refering to System::String here, then the appropriate way would be
to use String::Concat(). You might want to make hexChar an array of
System::Char or wchar_t, instead, though...
 
Thank you will do.

Tomas Restrepo (MVP) said:
Okay I know this is basic C++ but can someone tell me how to concatenate
char[] to string.
Ex:
char hexChar[]={'A','B','C','D','E','F'};
String *str ="A";

how can I do this:
str = hexChar[1] + hexChar[3]; or str = str + hexChar[3];

If you're refering to System::String here, then the appropriate way would be
to use String::Concat(). You might want to make hexChar an array of
System::Char or wchar_t, instead, though...
 
Back
Top