一维数组当成二维使用

#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( " " );
}

return 0;

}


原文地址:https://www.cnblogs.com/yxwkf/p/5251793.html