I was reading documentation for the std::getenv()
function on cppreference.com and it says
Modifying the string returned by getenv invokes undefined behavior.
Then why does the function not return a const char*
?
Then why does the function not return a
const char*
?
Probably because of compatibility with older c standards that don't support const
at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With