my question is if string is odd, add '0' at the end of the string, if it is even, tats alright. hope u guyz understand wat i mean.
example string size is odd , tats mean 0, 1, 2, 3, and i want to make it to even so add one size to it and it become odd = 0, 1, 2,3,4,5....
i want to ask that how can i resize the string ?
this is my code
str.resize(str.size() + 1, 0);
the string automaticaly changes size as you add/remove characters from it.
i am sorry, i dont understand
string str, str2; //str size = 0; str2 size = 0;
str = "This is a "; //str size = 11
str2 = "string"; //str size = 7
str += str2; //str size = 17
//size has changed from 11 to 17 automaticaly.