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 *f(); int main (int argc, char *argv[]) { int *p; p = f(); printf("%d",*p); return 0; } int *f() { static v = 1; return &v; } Choose the right answer:
Correct Answer: A
The program outputs 1 because the static variable v is initialized to 1 inside the f function, and it is visible to the main function. The f function returns the address of v, which is a pointer to an int. The main function dereferences the pointer and assigns it to p, which is another pointer to an int. Then, the main function prints the value of *p, which is the same as dereferencing p again. Therefore, the output of the program is: f() = &v p = f() printf("%d",*p) = &v = 1 The other options are incorrect because they either do not match the output of the program or do not use the correct concept of static variables.