1. ## precedence question

I read this in a book.

Code:
`apple = sizeof (int) * p;`
I tested the code and found out that it's sizeof integer multiplied by p. Can you some explain the precedence order of this?

thanks alot.

2. What's confusing? All you are doing is multiplying the size of an integer by the value of p. There's no precedence order confusion here. What else could it possibly be? All you are doing is taking two things, multiplying them, and assigning that value some place.

Quzah.

3. sizeof has higher precedence than multiplication operator.
So the exp is equivalent to
apple = (sizeof(int)) * p;
Guess what will be the value of :
apple = sizeof p * p; // don't forget to init p to some vale

4. It doesn't matter in what order multiplication is done in. Why the confusion?

5. OP is probably thinking: apple = sizeof (int) * p as
apple = sizeof( (int) *p); // say p is pointer to say (char)
which you need to know precedence.

If I'm not wrong, is it from Expert C Programming book?