Vidyalelo
C++ Programming · Q26

Arrays and Strings in C++

Programming · C++ Programming · question 26

Q26

What is the correct way to declare a string object named myString and initialize it with the value "Welcome" in C++?

A.
myString("Welcome");
B.
string myString = "Welcome";
Answer
C.
char myString[] = "Welcome";
D.
None of the above

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board