Are
int (*x)[10];
and
int x[10];
equivalent?
According to the clockwise rule , they analyze different C declarations.
For click fatigue:
"Clockwise / Spiral Rule" by David Anderson
There is a technology known as the `` Clockwise / Spiral Rule '' that allows any C programmer to analyze their head - any C declaration!
There are three simple steps:
1. Starting with the unknown element, move in a spiral/clockwise direction; when ecountering the following elements replace them with the corresponding english statements: [X] or [] => Array X size of... or Array undefined size of... (type1, type2) => function passing type1 and type2 returning... * => pointer(s) to... 2. Keep doing this in a spiral/clockwise direction until all tokens have been covered. 3. Always resolve anything in parenthesis first!
user191776
source share