Examveda

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";

C. char myString[] = "Welcome";

D. None of the above

Answer: Option B


Join The Discussion

Related Questions on Arrays and Strings in C plus plus