Chapter 10

  1. The printout is this:

    D D
    O O
    L L
    T T
    
  2. The array ref has an external storage class; it is a global variable with external linkage.

  3. The array name ref points to the first element of the array, the character D. The expression ref + 1 points to the second element, the character O. The construction ++ref is not a valid C expression; ref is a constant, not a variable.

  4. ptr points to the first element, and ptr + 2 points to the third element, which would be the first element of the second row.

    1. 12 and 16

    2. 12 and 14 (just the 12 goes in the first row because of the braces)

  5. ptr points to the first row and ptr+1 points to the second row; *ptr points to the first element in the first row, and *(ptr + 1) points to the first element of the second row. ...

Get C Primer Plus®, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.