C++ Language/Std/Strings/StringClass/Construction
Appearance
A std::string
object can be treated as a value (e.g., passing it into some function as a parameter value), because copy-construction has been provided.
Initializing a string as std::string strVar("abc");
is equivalent to std::string strVar = {'a', 'b', 'c'};
.
Additional information about string construction (includes interactive examples)