Playground
#include <iostream> #include <string> using namespace std; int main() { string a = "pocetok"; string b = " i "; string c = "kraj"; cout << a.size() << endl; //pechati '7' for (int i=0; i<c.size(); i++) cout << c[i] << " "; //pechati 'k r a j '; cout << endl; a += b; //a='pocetok i ' a.append(c); //a='pocetok i kraj' a.push_back('!'); //a='pocetok i kraj!' string res = b + c; //res=' i kraj' cout << res << endl; //pechati ' i kraj' return 0; }
Input data
Program output
no input
Execute
Language: ????????? | Memory: ???? KB | Time: ??? ms
Nothing has been executed, yet!