UC3M

Telematic/Audiovisual Syst./Communication Syst. Engineering

Systems Architecture

September 2017 - January 2018

5.5.2.  Self-assessment questions

  1. Pointer a contains the address of pointer b which contains the address of the integer c. Which of the following expression assigns the value 30 to the integer c?

    • *a = 30

    • **a = 30

    • ***a = 30

    • The assignment cannot be done

  2. Consider the following code fragment:

    struct data
    {
        int *ptr;
        int num;
    } a;
    
    a.ptr = &(a.num);

    Which of the following expressions assigns the value 10 to the num field of the a structure?

    • *(a.ptr) = 10

    • a.ptr = 10

    • a.*ptr = 10

    • a.ptr = *10

    • The assignment cannot be done using only the ptr field.