Answers for "concat 2 chars pointers in c++"

C++
0

add two constant char pointers c++

const char *one = "Hello ";
const char *two = "World";

string total( string(one) + two );

// to use the concatenation as const char*, use:
total.c_str()
Posted by: Guest on May-04-2021

Browse Popular Code Answers by Language