1.

Which function is used to get the length of a string object?(a) str.length()(b) str.size()(c) str.max_size()(d) both size() and length() functionI have been asked this question in an online interview.This interesting question is from String topic in division Source Files, Classes and Operator Overloading in C++ of C++

Answer» CORRECT CHOICE is (d) both SIZE() and length() function

Easy explanation - Both size() and length() are USED to get the size of the string OBJECTS.


Discussion

No Comment Found

Related InterviewSolutions