+ 1
Assume you declared int *p and p's current value is 1000. What is p + 1? Please any help?
#pointers
9 ответов
+ 4
p is a pointer holding address of a int variable.
Value of p depends on size of int.
Size of int depends on the compiler. In general 32 bit systems will have int size as 4 bytes (32 bit = 4*8 bit = 4bytes) to store int value.
So, if p=1000, then p+1=1000+4(size of int) =1004.
Hope this helps...!!!
+ 3
~ swim ~ is the Sizeof always 4?
+ 3
~ swim ~ thank you🙏🙏
+ 1
yes thanks Nagendra
so the 4 bit is always multiplying the number u plus it with the P ryt?
i.e. P+3= 1000+3*4 right?
+ 1
~ swim ~ so assuming it was p + 2,
will it be like p= 1000 + 2*4..
which is 1008?