Answered step by step
Verified Expert Solution
Question
1 Approved Answer
What will the following code printout? void Function(int *ptr) { *ptr = 11; } // In Main... int values[] = {4, 10, 6, 12, 8,
What will the following code printout?
void Function(int *ptr)
{
*ptr = 11;
}
// In Main...
int values[] = {4, 10, 6, 12, 8, 14};
int *p = &values[4];
Function(p);
for(int i = 2; i < 5; i++)
cout << values[i] << ' ';
a) 6 12 8 14
b) 6 12 8
c) 4 10 6 11 8 14
d) 6 12 11
e) 6 12 11 14
I know the answer is D, but I do not know why! Can someone please explain it to me ! Thank you
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