和编译器里面的规定有关系,const char *p = "hello world"; 这里的"hello world"是存放在字符常量区,所以正确的是用法是加上const。 可以参考下这篇文章:https://blog.csdn.net/donaldsy/article/details/106647709
点赞 1

相关推荐

09-09 16:12
已编辑
成都理工大学 Java
future0210:学java就是好啊,啥都能转
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务