MCQs
None.
In this program, We are printing the capacity and max size of the string.
Output:
$ g++ stri5.cpp
$ a.out
61073741820
This program will terminate because the cout element is out of range.
In this program, We are leaving the first 5 characters and last 7 characters and we are erasing
the remaining the characters.
Output:
$ g++ stri3.cpp
$ a.out
steve legend
rfind is used to find the characters in the string and replace is used to replace with certain characters.
Output:
$ g++ stri2.cpp
$ a.out
everbody does like this
'rbegin' is used to reverse the given the string.
Output:
$ g++ stri1.cpp
$ a.out
tfosorcim
In the program, We are concatanating the str1 and str2 and printing
it’s total length. So the length is 10.
Output:
$ g++ stri.cpp
$ a.out
10
Both will return the number of characters that conform the string's content.
Answer : c
Explanation:None.
C++ provides following two types of string representations. They are C-style character string and
string class type with Standard C++.