当前位置:网站首页>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;
/*对数组的引用总是可以写成对指针的引用,而且切实存在一种指针和数组完全相同的
*上下文环境,不幸的是,这只是数组的一种极为普通的用法,并非所有情况下都是如此,
*包括上面完全错误的“数组定义等同于指针的外部声明”这种情况。
*/
边栏推荐
- Use serve to build a local server
- Mini program + e-commerce, fun new retail
- Stop behind.
- 深度学习21天——卷积神经网络(CNN):实现mnist手写数字识别(第1天)
- 附加:对于“与数据表对应的实体类“,【面对MongoDB时,使用的@Id等注解】和【以前面对MySQL时,使用的@Id等注解】,是不同的;
- 路网编辑器技术预研
- See how DevExpress enriches chart styles and how it empowers fund companies to innovate their business
- Postgresql source code (66) insert on conflict grammar introduction and kernel execution process analysis
- 元宇宙“吹鼓手”Unity:疯狂扩局,悬念犹存
- share总结
猜你喜欢

For Qixi Festival, I made a confession envelope with code

系统设计.如何设计一个秒杀系统(完整版 转)

【21天学习挑战赛】图像的旋转问题(二维数组)

Reproduce 20-character short domain name bypass

drools from download to postman request success

7.LVS负载均衡群集之原理叙述

2022 Hangzhou Electric Power Multi-School League Game 5 Solution

mq应用场景介绍

System design. How to design a spike system (full version transfer)

3000 words, is take you understand machine learning!
随机推荐
7-2 LVS+DR概述与部署
备份工具pg_dump的使用《postgres》
Simple operation of the file system
外卖店优先级
[21 Days Learning Challenge] Image rotation problem (two-dimensional array)
基于 SSE 实现服务端消息主动推送解决方案
Implementing a server-side message active push solution based on SSE
Cache pool of unity framework
文件内容的操作
7-3 LVS+Keepalived集群叙述与部署
详解八大排序
类如何只能静态分配和只能动态分配
System design. Seckill system
System design. How to design a spike system (full version transfer)
3000字,一文带你搞懂机器学习!
The video of machine learning to learn [update]
什么是数字孪生智慧城市应用场景
docker安装mysql与宿主机相差8小时的问题。
拿捏JVM性能优化(自己笔记版本)
Metaverse "Drummer" Unity: Crazy expansion, suspense still exists