码迷,mamicode.com
首页 > 编程语言 > 详细

一维数组当成二维使用

时间:2014-10-16 14:29:42      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   使用   ar   for   sp   

#include <stdio.h>


int main(void)
{
int i, j;
int a[] = {11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35};
typedef int (*Type)[5];
Type b = (Type)a;

for(i = 0; i < 5; ++i)
{
for(j = 0; j < 5; ++j)
printf("%d ", b[i][j]);
printf( "\n" );
}

return 0;

}

bubuko.com,布布扣


一维数组当成二维使用

标签:style   blog   http   color   io   使用   ar   for   sp   

原文地址:http://blog.csdn.net/c1505011056/article/details/40146025

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!