1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>

int main(int argc, char* argv[]) {
    int n = 5;
    int* a_n = &n;      // Q1:  a_n is declared as a/an [_______________] (words)
                        //      … and initialized to the [________________] (words).
    int** a_a_n = &a_n; // Q2:  a_a_n is declared as a/an [_______________] (words),
                        //      … and initialized to the [________________] (words).
    // Q3: The type of *a_n is [______________] (code).
    // Q4: The type of *&a_n is [______________] (code).
    // Q5: The type of &a_a_n is [______________] (code).
    // Q6: The type of a_n[0] is [______________] (code).
    // Q7: The type of &a_a_n[0] is [______________] (code).
    ////////// Note:  &a_a_n[0] ↔ &(a_a_n[0])

    char s1[] = "abc";
    // Q8:  The type of s1[0] is [________].
    // Q9:  The type of &(s1[0]) is [________].
    // Q10: The type of *(&(s1[0])) is [________].

    char* s2 = "xyz";
    // Q11:  The type of s2[0] is [________].
    // Q12:  The type of &(s2[0]) is [________].
    // Q13:  The type of *(&(s2[0])) is [________].
    // Q14:  The type (s2 + 2) is [__________].
    // Q15:  The type *(s2 + 2) is [__________].
    return EXIT_SUCCESS;
}
/* vim: set tabstop=4 shiftwidth=4 fileencoding=utf-8 noexpandtab: */

© Copyright 2022 Alexander J. Quinn         This content is protected and may not be shared, uploaded, or distributed.