当前位置:网站首页>C language two-dimensional array is called with one-dimensional array
C language two-dimensional array is called with one-dimensional array
2022-08-03 09:33:00 【smith342】
I knew that the two-dimensional array in C language is stored in the memory as a one-dimensional array, but I have never tried to use a one-dimensional array to call a two-dimensional array.
The output of the following code is:
17 24 17
8 42 22
17 24 17 8 8 42 22
I thought the compilation would report an error, but no error was actually reported.
#include#include#includeint main(){int arr[2][3];srand(time(0));for(int i=0;i<2;i++)for(int j=0;j<3;j++)arr[i][j]=rand()%50+1;for(int i=0;i<2;i++){for(int j=0;j<3;j++)//cout<
边栏推荐
猜你喜欢
随机推荐
Redis实现分布式锁
长短期记忆网络 LSTM
Redis和MySQL如何保持数据一致性
Apple Silicon配置二进制环境(二)
【微信小程序】底部有安全距离,适配iphone X等机型的解决方案
Flink Yarn Per Job - 创建启动Dispatcher RM JobManager
Cartesi 2022 年 7 月回顾
Index (3)
MySQL 主从切换步骤
MySQL8重置root账户密码图文教程
Industry SaaS Microservice Stability Guarantee Actual Combat
013-二叉树
mysql的union和union all
Alibaba Cloud SMS Sending
行业 SaaS 微服务稳定性保障实战
"Easy to use" websites that others don't know, make you more efficient
【LeetCode】622.设计循环队列
Let‘s Encrypt 使用
js中最简单base64图片流实现自动下载
软体按摩机器人驱动器的设计与仿真