Valid CLA-11-03 Dumps shared by ExamDiscuss.com for Helping Passing CLA-11-03 Exam! ExamDiscuss.com now offer the newest CLA-11-03 exam dumps, the ExamDiscuss.com CLA-11-03 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com CLA-11-03 dumps with Test Engine here:
What happens if you try to compile and run this program? #include <stdio.h> int *fun(int *t) { return t + 4; } int main (void) { int arr[] = { 4, 3, 2, 1, 0 }; int *ptr; ptr = fun (arr - 3); printf("%d \n", ptr[2]); return 0; } Choose the right answer:
Correct Answer: D
1.A function fun is defined that takes a pointer to an integer t and returns t + 4. 2.The main function defines an array arr with the elements { 4, 3, 2, 1, 0 }. 3.It then calls fun with the argument arr - 3. Since arr points to the first element of the array, arr - 3 is actually pointing to 3 positions before the start of the array, which is out of bounds. 4.Inside fun, t + 4 would effectively be arr + 1 (arr - 3 + 4). 5.The returned pointer from fun (which is arr + 1) is assigned to ptr. 6.ptr[2] is then the same as arr[1 + 2], which is arr[3]. The value at arr[3] is 1.