2 ms·
String literals are not const char *, but const char[] in C++. They decay to a pointer when you pass them to the std::string constructor that takes one.
by saagarjha 2y ago
String literals are not const char *, but const char[] in C++. They decay to a pointer when you pass them to the std::string constructor that takes one.