本帖最后由 丁铭检 于 2015-7-21 10:41 编辑
- void foo(int[][3]);
- int main(void)
- {
- int a[3][3] = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} };
- for (int i =0; i < 3; i++) {
- for (int j =0; j < 3; j ++) {
- printf("%d\t",a[i][j]);
- }
- printf("\n");
- }
- printf("\n");
- printf("\n");
- foo(a);
- for (int i =0; i < 3; i++) {
- for (int j =0; j < 3; j ++) {
- printf("%d\t",a[i][j]);
- }
- printf("\n");
- }
- printf("%d\n", a[2][1]);
- return 0;
- }
- void foo(int b[][3])
- {
- ++b;
- printf("\n");
- printf("\n");
- for (int i =0; i < 3; i++) {
- for (int j =0; j < 3; j ++) {
- printf("%d\t",b[i][j]);
- }
- printf("\n");
- }
- b[1][1] = 9;
- }
复制代码 |