0
How to concatenate string arrays in c++?
5 odpowiedzi
+ 3
with the operator +
for example
string new = "hey " + "you!";
+ 6
@Rajesh k Yadav
Sure! What do you need to know?
PS - Can you make a seperate thread for that? We shouldn't post things here that are unrelated to the original thread.
+ 3
Basic C-strings (Null Terminated character arrays) were concatenated using the strcat() function.
It cannot be used with std::string, though you may append an std::string to a char array using strcat like this:
char str[20]="Hello World";
std::string str2 = "!.";
strcat(str,str2.c_str());
// str becomes -> Hello World!.
Also, std::strings can be concatenated with the + or += operators, or using an append() method, which can even receive char arrays as input.
So that makes a total of 4 types of functions that are available in general in C++ for concatenation of strings, in general...
0
yes...but how many other ways are possible?
0
Anyone here who help me to know array I'm really tired to know array