Examveda

Which is the correct way of concatenating a character at the end of a string object?
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

Answer: Option C


Join The Discussion

Related Questions on Classes and Objects in C plus plus