Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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+ + 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started