Question & Answer: Consider the following C++ code and what is the output of this program? #include usin…..

5) and what is the output of this program? #include <iostream> using nanespace std int main Int array-t5,7, 10, 9 int **p (array + i); cout << array 10 system( pause)z return 07 a) 11 b) 6 c) 13 d) error

Consider the following C++ code and what is the output of this program? #include using namespace std: int main() { int array{} = {5, 7, 10, 9}: int **p = (array + 1): cout

Expert Answer

 

Don't use plagiarized sources. Get Your Custom Essay on
Question & Answer: Consider the following C++ code and what is the output of this program? #include usin…..
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS $13/PAGE
Order Essay

Solution:   d) error

Explanation:

#include <iostream>

using namespace std;

int main()
{
int arr[]={5,7,10,9};
int **p= (arr+1); //error: cannot convert ‘int*’ to ‘int**’ in initialization
cout<<**arr+10; //error: invalid type argument of unary ‘*’ (have ‘int’)
system(“pause”);
return 0;
}

Still stressed from student homework?
Get quality assistance from academic writers!