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
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