Page 1 of 1

Which is the correct way of concatenating a character at the end of a string object?

Posted: Wed Jul 13, 2022 7:52 pm
by answerhappygod
way 1:
string s;
s = s + 'a';
 
way 2:
string s;
s.push_back('a');
a) 1 only
b) 2 only
c) both of them
d) both are wrong