Page 137 - C-Language
P. 137

Alternative Interpretation




        Because declarations mirror use, a declaration can also be interpreted in terms of the operators
        that could be applied over the object and the final resulting type of that expression. The type that
        stands on the left-hand side is the final result that is yielded after applying all operators.


         /*
          * Subscripting "arr" and dereferencing it yields a "char" result.
          * Particularly: *arr[5] is of type "char".
          */
         char *arr[20];

         /*
          * Calling "fn" yields an "int" result.
          * Particularly: fn('b') is of type "int".
          */
         int fn(char);

         /*
          * Dereferencing "fp" and then calling it yields an "int" result.
          * Particularly: (*fp)() is of type "int".
          */
         int (*fp)(void);

         /*
          * Subscripting "strings" twice and dereferencing it yields a "char" result.
          * Particularly: *strings[5][15] is of type "char"
          */
         char *strings[10][20];


        Read Data Types online: https://riptutorial.com/c/topic/309/data-types










































        https://riptutorial.com/                                                                             113
   132   133   134   135   136   137   138   139   140   141   142