且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从函数返回的字符串字面值地址安全可移植?

更新时间:2023-02-03 09:30:01

Is the second alternative safe and portable in this scenario?

Yes! The storage allocation of string literals is static and they persist for the lifetime of the application.