36 ms·
It teaches declaration-mirrors-use char *a => *a is a char char a[3] => a[i] is a char char f(char) => f(c) is a char char (*f)(char)
by edflsafoiewq 6y ago
It teaches declaration-mirrors-use
char *a => *a is a char
char a[3] => a[i] is a char
char f(char) => f(c) is a char
char (*f)(char) => (*f)(c) is a char (short form: f(c))
- TomSwirly 6y agoBut that doesn't mean it's understandable!
- richardwhiuk 6y agoWith the minor problem that `a[3]` isn't valid.
- edflsafoiewq 6y agoDepends how you use it (&a[3], sizeof(a[3])). But its type is still char.
- richardwhiuk 6y agoIIRC, both of those are undefined.
- edflsafoiewq 6y ago&a[3] is allowed, it's a one-past-the-end-of-the-array pointer. &a[4] would be UB (if it were evaluated). sizeof(a[3]) is not evaluating a[3], so it also isn't UB.