dreferencing 2二维数组 [英] dreferencing 2 d array

查看:148
本文介绍了dreferencing 2二维数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请看看这个peice的的code: -

Please look at this peice of code :-

#include<stdio.h>
int main()
{
int arr[2][2]={1,2,3,4};
printf("%d %u %u",**arr,*arr,arr);
return 0;
}

当我编译和执行这个方案,我得到的编曲和*改编这是2维数组的起始地址相同的值。 例如: - 1 3214506 3214506

When i compiled and executed this program i got same value for arr and *arr which is the starting address of the 2 d array. For example:- 1 3214506 3214506

我的问题是为什么提领ARR(* ARR)不打印存储在包含在ARR地址的值?

My question is why does dereferencing arr ( *arr ) does not print the value stored at the address contained in arr ?

推荐答案

*改编为整数长度为2的数组,因此它共享相同的地址编曲。它们都指向他们的数组的开始,这是相同的位置。

*arr is type integer array of length 2, so it shares the same address as arr. They both point to the beginning of their arrays, which is the same location.

这篇关于dreferencing 2二维数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆