Tuesday, June 7, 2011

5.12 Complicated Declarations

  • C is sometimes castigated for the syntax of its declarations, particularly ones that involve pointers to functions 
  • The syntax is an attempt to make the declaration and the use agree; it works well for simple cases, but it can be confusing for the harder ones, because declarations cannot be read from left to right, and because parentheses are over-used. 
  • Problem:

  •  * is a prefix operator and it has lower precedence than ( ), so parentheses are necessary to enforce proper association

No comments:

Post a Comment