Examveda
Examveda

Which of the following correctly defines a string variable named name initialized with the value "John" in C++?

A. string name = "John";

B. char name[] = "John";

C. char* name = "John";

D. string name("John");

Answer: Option A


Join The Discussion

Related Questions on Arrays and Strings in C plus plus