关闭

多维数组和指针(一)

513人阅读 评论(0) 收藏 举报
/* zippo1.c --  zippo info */
#include <stdio.h>
int main(void)
{
    int zippo[4][2] = { {2,4}, {6,8}, {1,3}, {5, 7} };
    
    printf("   zippo = %p,    zippo + 1 = %p\n",
               zippo,         zippo + 1);
    printf("zippo[0] = %p, zippo[0] + 1 = %p\n", 
            zippo[0],      zippo[0] + 1);
    printf("  *zippo = %p,   *zippo + 1 = %p\n", 
              *zippo,        *zippo + 1);
    printf("zippo[0][0] = %d\n", zippo[0][0]);
    printf("  *zippo[0] = %d\n", *zippo[0]);
    printf("    **zippo = %d\n", **zippo);
    printf("      zippo[2][1] = %d\n", zippo[2][1]);
    printf("*(*(zippo+2) + 1) = %d\n", *(*(zippo+2) + 1));

    return 0;
}

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:56284次
    • 积分:1013
    • 等级:
    • 排名:千里之外
    • 原创:18篇
    • 转载:31篇
    • 译文:0篇
    • 评论:5条
    文章分类
    最新评论