3 ms·
Coming back to C after several years, I now think one of the hard things about pointers in C is the C syntax for pointers, not just the idea of pointers in gene
by DougBTX 6y ago
Coming back to C after several years, I now think one of the hard things about pointers in C is the C syntax for pointers, not just the idea of pointers in general. Eg, sometimes the type declaration wraps around both sides of the variable name:
int a[2];
int (*ap)[2] = &a; // pointer to array of int
It makes it harder to see what’s what.
- kahlonel 6y agoI agree that it is confusing. Here [1] is something that can help new C programmers to understand these kind of declarations. It gets easier after a while. [1]. http://c-faq.com/decl/spiral.anderson.html http://c-faq.com/decl/spiral.anderson.html
- zzo38computer 6y agoYes, I think the confusing syntax of types is one of the actually bad things in the C programming language.