Question: Pointers Question 2 (a) Provide a single line of C+ + code that will declare a variable that points to a string value, the variable

 Pointers Question 2 (a) Provide a single line of C+ +

Pointers Question 2 (a) Provide a single line of C+ + code that will declare a variable that points to a string value, the variable is named x. [2 marks] (b) You have array c declared as string *c [5]; Give the single line of C++ code that will assign the string pointer stored in [2 marks] (c) Write a for loop that initialises the contents of each element of the array c to [3 marks] variable x (from above) to the third element of the array c. the NULL pointer. (d) You have the following declarations at the start of a function: int i,j; int *nums [3]; int *x; Briefly explain what will happen if the function attempts to execute the state- ment: nums [-1]-&j; [3 marks] (e) Are the contents of a pointer checked at compile-time or run-time? Briefly explain your answer. [2 marks]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!