...

/

Quiz on Strings and Arrays

Quiz on Strings and Arrays

Test your knowledge of strings and arrays in C++.

We'll cover the following...
Technical Quiz
1.

(Select all that apply.) We want to store the following string in the variable msg. Which of the following shows the correct syntax in C++?

This string has text1 and text2 in it
A.

string msg = "This string has text1 and text2 in it";

B.

string msg = 'This string has text1 and text2 in it';

C.

string msg = "This string has text1 " and " text2 in it";

D.

string str1 = "This string has text1";

string str2 = " and text2 in it";

string msg = str1 + str2;


1 / 6
...