✍️ Get Writing Help
WhatsApp

Dereference pointers

Given the declaration:

int num1, num2;

int *p1;

int *p2;

double *p3;

Mark the following statements as valid or invalid. If a statement is invalid, explain why. (2, 3)

a. p1 = &num1;

b. num2 = num1 – *p2;

c. p3 = p2;

d. *p3 = num1; e. *p3 = *p1;

f. num1 5 p2;

g. p1 = &p2;

h. p3 = &num1;

i. num1 = *p3;

j. num2 = &p1;

a. How is * used to create pointers? Give an example to justify your answer. (2)

b. How is * used to dereference pointers? Give an example to justify your answer. (2)

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102