char*="xxx"
来源:互联网 发布:android源码语法 编辑:程序博客网 时间:2024/06/06 00:38
#include <iostream>using namespace std;char *pr="i am well";void change(char* p){ //*(p+2)='2';}int main(){int x,y,z;change(pr);cout<<*pr<<endl;}
"i am well" 是字符常量无法修改,所以报错!
#include <iostream>using namespace std; const char *pr="i am well";void change(const char* p){ //*(p+2)='2';}int main(){int x,y,z;change(pr);cout<<*pr<<endl;}
OK
阅读全文
0 0
- char*="xxx"
- 关于char *c = "xxx"
- java.lang.IllegalArgumentException: The char 'xxx ' in 'xxx'
- [dfs基础]XXX+XXX=XXX
- JS逻辑运算 xxx = xxx || ''
- 关于error LNK2005: "char * xxx" (?xx@@3PADA) already defined in xxx
- 关于error LNK2005: "char * xxx" (?xx@@3PADA) already defined in xxx
- char *p=new char
- char *p=new char
- xxx.equals(null),xxx==null
- self.xxx = nil
- LD_DEBUG=xxx
- xxx
- xxx
- xxx
- XXX
- xxx
- xxx
- ES6之函数的拓展(部分)
- 【Python】实现一个天气查询
- javascript学习笔记
- SharedPreferences存储数据
- 小白玩转爬虫!(Python)
- char*="xxx"
- 自用基础4-方法
- linux debian系统配置apache2的SSL证书
- 方法与数组
- 图像背后的数学--直方图
- ural1009(动态规划)
- 回调函数
- 虚拟机如何实现的?
- 敏捷开发 —— TDD(测试驱动开发)