Vidyalelo
C++ Programming · Q167

Classes and Objects in C++

Programming · C++ Programming · question 167

Q167

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
Answer
D.
both are wrong

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board