

MCQOPTIONS
Saved Bookmarks
This section includes 8 Mcqs, each offering curated multiple-choice questions to sharpen your C++ Programming knowledge and support exam preparation. Choose a topic below to get started.
1. |
What is the identifier given to string class to declare string objects? |
A. | String |
B. | string |
C. | STRING |
D. | Any of the above can be used |
Answer» C. STRING | |
2. |
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() function |
Answer» E. | |
3. |
Which of the following is not a modifier function in string class? |
A. | operator+=() |
B. | operator[]() |
C. | push_back() |
D. | erase() |
Answer» C. push_back() | |
4. |
Which header file is used to include the string object functions in C++? |
A. | #include <string.h> |
B. | #include <cstring> |
C. | #include <string> |
D. | #include <string.cpp> |
Answer» D. #include <string.cpp> | |
5. |
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» D. String objects use extra memory than required. | |
6. |
Pick the incorrect statement about Character-Array. |
A. | Character-Array can be terminated by a null character( 0 ) |
B. | Character-Array has a static size |
C. | Character-Array has a dynamic size |
D. | Character-Array has a threat of array-decay |
Answer» D. Character-Array has a threat of array-decay | |
7. |
What is Character-Array? |
A. | array of alphabets |
B. | array of well-defined characters |
C. | array of characters |
D. | array of characters terminated by 0 |
Answer» D. array of characters terminated by 0 | |
8. |
What is string objects in C++? |
A. | Stream of alphabets |
B. | A stream of well-defined characters |
C. | Stream of characters |
D. | A stream of characters terminated by 0 |
Answer» C. Stream of characters | |