Saturday, 12 March 2016

Declare a string object and initialize it to the string "Waldorf Salad".

Leave a Comment

Question:

Declare a string object and initialize it to the string "Waldorf Salad".

Answer:

string lunch = "Waldorf Salad";
or, if you don’t have a using directive,
std::string lunch = "Waldorf Salad";

Source:

C++ Primer Plus Sixth Edition Chapter Review

If You Enjoyed This, Take 5 Seconds To Share It

0 Questions: