指针部分代码解析

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/better12038/article/details/80233167
1.
    #include <stdio.h>
    int main()
    {

        int a[3][2] = {(0,1),(2,3),(4,5)};
//该语句中包含逗号表达式,即为int a[3][2] = {1,3,5}

        int *p;

        p = a[0];
//p指向数组a中的第1个元素的地址

        printf("%d\n",p[0]);    
//p[0]相当与对p解引用

//输出结果为1

猜你喜欢

转载自blog.csdn.net/better12038/article/details/80233167
今日推荐