Shouldn't the output be 6 as it should print B[0][2] ? The output is coming out to be 4. which is B[1][0]
main()
{
int B[2][3]={2,3,6,4,5,8};
printf("%d",**B+2);
}
**B+2
is equivalent to (**B) + 2
**B
is equal to B[0][0]
which is 2
in your array.
Hence the seen output.
If you want 6
, what you need is *(*B + 2)
More info on this here and here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With