当前位置:网站首页>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;
/*对数组的引用总是可以写成对指针的引用,而且切实存在一种指针和数组完全相同的
*上下文环境,不幸的是,这只是数组的一种极为普通的用法,并非所有情况下都是如此,
*包括上面完全错误的“数组定义等同于指针的外部声明”这种情况。
*/
边栏推荐
猜你喜欢

转:管理是对可能性的热爱,管理者要有闯进未知的勇气

2022 Hangzhou Electric Power Multi-School League Game 5 Solution

el-Select 选择器 底部固定

Postgresql源码(66)insert on conflict语法介绍与内核执行流程解析

深度学习21天——准备(环境配置)

3000 words, is take you understand machine learning!

Take care of JVM performance optimization (own note version)

Explain详解与实践

3000字,一文带你搞懂机器学习!

Reproduce 20-character short domain name bypass
随机推荐
Senior PHP development case (1) : use MYSQL statement across the table query cannot export all records of the solution
TL431的基本特性以及振荡电路
小程序 + 电商,玩转新零售
Explain详解与实践
备份工具pg_dump的使用《postgres》
OpenGL绘制一个圆锥
大型连锁百货运维审计用什么软件好?有哪些功能?
Shell 函数
Metaverse "Drummer" Unity: Crazy expansion, suspense still exists
Introduction to mq application scenarios
This Thursday evening at 19:00, the fourth live broadcast of knowledge empowerment丨The realization of equipment control of OpenHarmony smart home project
if,case,for,while
PL/SQL Some Advanced Fundamental
7-3 LVS+Keepalived Cluster Description and Deployment
八年软件测试工程师带你了解-测试岗进阶之路
Deep learning -- CNN clothing image classification, for example, discussed how to evaluate neural network model
Embedded database development programming MySQL (full)
文件系统的简单操作
3000 words, is take you understand machine learning!
文件内容的操作