Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: