c - Clarfication on pointer arithmetic -


*(*(p+a)+b) 

if a*size added address (p), why b*size added *(p+a)? *(p+a) appears value @ location , adding b*size change value, not address. however, based on read meant added address.

given expression, , assuming you're talking c, p must pointer pointer. happens is:

char ** p; int = 2; int b = 4;  (p+a) // adds 2 * sizeof(char *) *(p+a) // evaluates char * char * c = *(p+a) (c+b) // adds 4 * sizeof(char) *(c+b) // evaluates char 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -