Explain why you cannot use a range-based for loop on dynamic arrays. (9)
What is wrong with the following code? (9)
double *p; //Line 1
p = new double[5]; //Line 2
for (int i = 0; i <>
p[i] = pow(i, 2.0); //Line 4
for (auto x: p) //Line 5
cout <><>
cout <>
Explain the difference between a shallow copy and a deep copy of data. (11)
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here