Y
Hacker News
new
|
ask
|
show
|
jobs
by
deschutes
1520 days 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.
1 comments
cornstalks
1520 days ago
I 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);”
link
deschutes
1520 days ago
I missed that. You're right.
link
In particular, my comment was referring to “return std::to_string(number);”