Mam tak:
int a = 3;
char b = char(65);
char c = char(67);
string whole;
jak teraz zolozyc do stringa te dane? zeby bylo
whole = a+b+c;
Mam tak:
int a = 3;
char b = char(65);
char c = char(67);
string whole;
jak teraz zolozyc do stringa te dane? zeby bylo
whole = a+b+c;
Wskazówki:
-http://www.cplusplus.com/reference/string/string/ i tutaj konstruktory,operator += lub metoda append()
-pogóglaj za hasłem "convert int to string c++"
Dziala super generalnie tak:
ostringstream outString;
outString << a << b << c;
cout << outString.str();
I moze byc tak ze 'a' to int, 'b' string, 'c' to char
a wszystko wywali jako string :D
dzieki