当前位置:网站首页>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< 边栏推荐
猜你喜欢
随机推荐
响应式布局经典范例——巨幅背景大标题
GO开发环境配置
Flink Yarn Per Job - Submit application
二叉查找树的插入
Index (3)
索引(三)
STP生成树(端口状态+端口角色+收敛机制 )|||| STP优化技术( uplinkfast技术+Portfast技术+backbonefast技术 )详解
批量将PNG格式转化为JPG格式
go泛型使用方法
基于二次型性能指标的燃料电池过氧比RBF-PID控制
深度学习之 10 卷积神经网络1
【LeetCode】101. Symmetric Binary Tree
cmd(命令行)操作或连接mysql数据库,以及创建数据库与表
使用 Scrapy 框架对重复的 url 无法获取数据,dont_filter=True
10 minutes to get you started chrome (Google) browser plug-in development
【LeetCode】zj面试-把字符串转换成整数
Scala parallel collections, parallel concurrency, thread safety issues, ThreadLocal
013-二叉树
浅聊缓存函数
selenium IDE的3种下载安装方式









