C type casts and addition precedence
Cast trumps binary addition according to the precedence table.
((char*)heap) + offset
It's ((char *)heap) + offset
. Casts have much higher precedence than addition.
The cast is done first, since it has a much higher precedence.
You can look that up in the C precedence table: