Order of operations for dereference and bracket-ref in C

Claudiu picture Claudiu · Aug 24, 2010 · Viewed 12.7k times · Source

If I do *ptr[x], is that equivalent to *(ptr[x]), or (*ptr)[x]?

Answer

Justin Ardini picture Justin Ardini · Aug 24, 2010

*(ptr[x])

See the Wikipedia operator precedence table, or, for a more detailed table, this C/C++ specific table.