Concatenation
Put your sting together
//ใช้เครื่องหมาย +
#include <iostream>
#include <string.h>
using namespace std;
int main()
{ string M = "Hello ";
string N = "world";
string O = M+N;
cout << O <<endl;
return 0;
} //ใช้คำสั่ง string.append()
#include <iostream>
#include <string.h>
using namespace std;
int main()
{ string M = "Hello ";
string N = "world";
string O = M.append(N);
cout << O <<endl;
return 0;
} 


Last updated
Was this helpful?