当前位置:网站首页>C专家编程 第4章 令人震惊的事实:数组和指针并不相同 4.2 我的代码为什么无法运行
C专家编程 第4章 令人震惊的事实:数组和指针并不相同 4.2 我的代码为什么无法运行
2022-08-04 04:44:00 【weixin_客子光阴】
/*令人震惊的事实:数组和指针并不相同*/
/*4.1 数组并非指针*/
/*x is pointer point to type int*/
extern int *x;
/*y is an array of elements is type int, the length is not certain. It's storage by definited in somewhere.*/
extern int y[];
/*我的代码为什么无法运行*/
/*类型不匹配*/
//文件1:
int mango[100];
//文件2:
extern int *mango;
...
/*一些引用mango[i]的代码*/
/*类型不匹配*/
//文件1:
int guava;
//文件2:
extern float guava;
/*对数组的引用总是可以写成对指针的引用,而且切实存在一种指针和数组完全相同的
*上下文环境,不幸的是,这只是数组的一种极为普通的用法,并非所有情况下都是如此,
*包括上面完全错误的“数组定义等同于指针的外部声明”这种情况。
*/
边栏推荐
- Metaverse "Drummer" Unity: Crazy expansion, suspense still exists
- 数据治理平台项目总结和分析
- 烧录场景下开发如何进行源代码保密工作
- el-Select 选择器 底部固定
- 如何简化现代电子采购的自动化?
- Tensors - Application Cases
- Senior PHP development case (1) : use MYSQL statement across the table query cannot export all records of the solution
- System design. Seckill system
- 2.15 keil使用电脑端时间日期
- drools from download to postman request success
猜你喜欢
随机推荐
How to systematically plan and learn software testing?
mq应用场景介绍
大型连锁百货运维审计用什么软件好?有哪些功能?
【流程图】
震惊,99.9% 的同学没有真正理解字符串的不可变性
Use serve to build a local server
Stop behind.
结构体函数练习
Shell 函数
Turn: Management is the love of possibility, and managers must have the courage to break into the unknown
PHP高级开发案例(1):使用MYSQL语句跨表查询无法导出全部记录的解决方案
2022软件测试面试题 最新字节跳动50道真题面试题 刷完已拿下15k 附讲解+答疑
7-1 LVS+NAT load balancing cluster, NAT mode deployment
OpenGL绘制圆
centos 安装postgresql13 指定版本
QT 如何识别文件的编码格式
什么是数字孪生智慧城市应用场景
Tensors - Application Cases
How to open a CITIC Securities online account?is it safe?
Bolb analysis of image processing (1)