标签:test col image span define ++ 通过 数组 print
#include <stdio.h> #define COLS 10 #define ROWS 6 char erwei[6][10]={{1,2,3,4,5,6,7,8,9,10}, {10,9,8,7,6,5,4,3,2,1}, {1,2,3,4,5,6,7,8,9,10}, {10,9,8,7,6,5,4,3,2,1}, {1,2,3,4,5,6,7,8,9,10}, {10,9,8,7,6,5,4,3,2,1} }; test (char *image){ int i,j=0; for(i=0;i<COLS*ROWS;i++){ printf("image[%d][%d]%d\n",i,j,*image); image++; } } test2 (char *image){ int i,j=0; for(i=0;i<ROWS;i++){ for(j=0;j<COLS;++j){ printf("image[%d][%d]%d\n",i,j,image[i*10+j]); } } } void main() { test((char *)erwei); // test(&erwei); printf("\n\n\n"); test2((char *)erwei); // test2(&erwei); return 0; }
标签:test col image span define ++ 通过 数组 print
原文地址:https://www.cnblogs.com/ligei/p/12183085.html