Complete the code to declare a volatile integer variable named flag.
volatile [1] flag;The volatile keyword tells the compiler that the variable flag can change unexpectedly, so it should not optimize access to it. Here, flag is an integer.
Complete the code to declare a pointer to a volatile unsigned char named ptr.
volatile [1] *ptr;volatile after the asterisk.The pointer ptr points to a volatile unsigned char. The volatile keyword applies to the data pointed to, not the pointer itself.
Fix the error in the code by completing the declaration of a pointer to a volatile int named p.
[1] int *p;int volatile *p; which is valid but not the expected style here.The keyword volatile before int means the pointer points to a volatile int. Writing volatile int *p; is correct. Here, the blank is for the keyword volatile.
Fill both blanks to complete the code that declares a pointer to a volatile int named vp.
[1] [2] *vp;
volatile int together in one blank (not allowed here).The correct declaration is volatile int *vp; which means vp points to a volatile int. The first blank is the keyword volatile, the second blank is the type int.
Fill all three blanks to complete the code that declares a pointer to a volatile unsigned int named vup.
[1] [2] [3] *vup;
signed instead of unsigned.The declaration volatile unsigned int *vup; means vup points to a volatile unsigned int. The blanks are filled with volatile, unsigned, and int respectively.