4 ms·
String literals are specified to have static storage duration. That means references are valid at least until main returns. In practice string literals are immo
by deschutes 4y ago
String literals are specified to have static storage duration. That means references are valid at least until main returns. In practice string literals are immortal and references to them are always valid.
- cornstalks 4y agoI didn’t say string literal. I said “locally created string” i.e. std::string In particular, my comment was referring to “return std::to_string(number);”
- deschutes 4y agoI missed that. You're right.