Question: C++ language only, Please fix the code so it will compile and run without crashing. Should be 3 problems and additions and/or modifications you'll need
C++ language only,
Please fix the code so it will compile and run without crashing.
Should be 3 problems and additions and/or modifications you'll need to complete.
#include
for (int i = 0; i <= SIZE; i++) value[i] = i * 2; for (int i = 0; i < SIZE; i++) { cout << *ptr << endl; ptr++; }
cout << *(--ptr) << endl; for (int i = 0; i < SIZE; i++) { cout << *current << endl; current++; }
cout << *(ptr) << endl; cout << *(- -current) << endl;
for (int i = 0; i <= SIZE; i++) *(ptr++) = i * 2;
for (int i = 0; ptr <= &value[SIZE - 1]; ptr += 1) *ptr = i++ * 2;
ptr- -; cout << "The value where pointer 'ptr' pointing to is: " << *ptr << endl;
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
