当前位置:网站首页>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<
边栏推荐
猜你喜欢
随机推荐
CRT命令按键
"Easy to use" websites that others don't know, make you more efficient
【快手面试】Word2vect生成的向量,为什么可以计算相似度,相似度有什么意义?
AUC的两种计算方式
Go操作Redis数据库
SQL试题
Machine learning (formula derivation and code implementation)--sklearn machine learning library
pytorch one-hot tips
STP生成树(端口状态+端口角色+收敛机制 )|||| STP优化技术( uplinkfast技术+Portfast技术+backbonefast技术 )详解
【LeetCode】622.设计循环队列
面试突击71:GET 和 POST 有什么区别?
Redis实现分布式锁
Exception: Dataset not found.解决办法
多媒体数据处理实验4:LSH索引
LINGO 18.0软件安装包下载及安装教程
10 Convolutional Neural Networks for Deep Learning 2
Does setting the following sysctl settings require a system reboot?
【LeetCode】622. Design Circular Queue
Redis和Mysql数据同步的两种方案
多媒体数据处理实验1:算术编码