C type casts and addition precedence

前端 未结 4 933
甜味超标
甜味超标 2020-12-15 17:51

What\'s the precedence in the next expression?

item = (char*)heap + offset;

Is it (char*)(heap + offset) or ((char*)heap

4条回答
  •  北海茫月
    2020-12-15 18:03

    The cast is done first, since it has a much higher precedence. You can look that up in the C precedence table!

提交回复
热议问题