Library String and String Literals are different

closed account (EwCjE3v7)
What do they mean when they say this in my book?
"String literals are not standard library strings"
Last edited on
String literals are of type char const * - that is, a string literal evaluates to a pointer to the first character, and the character of the string literal are constant.

The std::string type is a class with data members and member functions, on the other hand.

There are also different kinds of string literals, like wide string literals and utf8 string literals:
http://en.cppreference.com/w/cpp/language/string_literal
Last edited on
closed account (EwCjE3v7)
Thank you L B.
Topic archived. No new replies allowed.