简体   繁体   中英

double pointers in C programming

I have a statement which I need help with:

int  i=2, j=5, *p = &j, *q = &i;

and this is the question..

&i == p    //is this true?
7 * *q / *p + 3    //is this legal?

I am pretty sure the second statement is illegal but I don't know why? can anyone please explain me this.

Second statement is equivalent to

( (7 * *q) / *p ) + 3  

In sub-expression (7 * *q) / *p , first * (from left to right) is for multiplication and second is for dereference .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM