hi everyone,
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 [4], tats mean 0, 1, 2, 3, and i want to make it to even so add one size to it and it become odd[5] = 0, 1, 2,3,4,5....
i want to ask that how can i resize the string ?
this is my code
Code:while(str.size()%2!=0) { str.resize(str.size() + 1, 0); } cout<<str<<endl;