Pick the correct statement about string objects in C++.

Pick the correct statement about string objects in C++.
A. String objects must be terminated by a null character(‘\0’)
B. String objects have a static size
C. String objects have a dynamic size
D. String objects use extra memory than required.
 
Answer: c
Explanation: String objects are dynamic in nature i.e. their size varies as their value changes so they don’t use any extra memory and it is not necessary to terminate a string object by ‘\0’.
 

Tìm kiếm

Back
Top