Discussion Overview
The discussion revolves around the interpretation of complex pointer declarations in C/C++, specifically focusing on two declarations: (a) int*p[3][3] and (b) int*(*p())[10]. Participants explore the meaning of these declarations, their implications, and the potential for confusion in their usage.
Discussion Character
- Technical explanation
- Debate/contested
Main Points Raised
- Some participants suggest that (a) represents a 3-dimensional array where each element is a pointer to an integer, while others clarify that it is a 3x3 array of integer pointers.
- There is a discussion about the declaration
int a[3], with some stating it is simply an array, while others argue it points to information at a specific index.
- Participants express differing views on (b), with some suggesting it indicates obfuscated code and others attempting to clarify its meaning as an array of function pointers.
- One participant points out that
int*(*p())[10] is problematic in terms of syntax, suggesting that it should be int*(*p[10])(); instead.
Areas of Agreement / Disagreement
Participants do not reach a consensus on the interpretations of the declarations, with multiple competing views and some confusion regarding the syntax and semantics of the code.
Contextual Notes
There are unresolved issues regarding the correct interpretation of pointer declarations and the implications of syntax in C/C++. Some assumptions about the nature of arrays and pointers are not fully clarified.