Computer Science, asked by venuNaidu1081, 9 months ago

Suppose that p is a pointer variable that contains the null pointer. What happens if your program tries to read or write *p? Select one:

a. The results are unpredictable.

b. Run-time error always occurs when *p is evaluated.

c. None of the above

d. A run-time error always occurs when the program finishes.

e. A syntax error always occurs at compilation time.

Answers

Answered by sailorking
0

Answer:

According to the question, the answer is option "b) Run time error always occurs when *p is evaluated".

Explanation:

The reason for this answer is because there are two kinds of variables, one is the normal one which is used to store data, and the other one is to store the address of a normal variable, it is used to store and retrieve the value of the data to which it is pointing, but if the pointer variable is not pointing any variable, then there shall be a run time error when tried to make changes by the pointer variable.

Similar questions