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