Question: : Consider the C program: #include int * f ( int choice, int x ) { int y = x; if ( choice = =
: Consider the C program: #include int f int choice, int x int y x; if choice return &x; else return &y; void main int argc, char argv int a ; int b ; int p f a; int q f b; printf d
p; printf d
q; Consider the following statements: The contents of local variable p is a pointer to a heapallocated object. The contents of local variable q is a dangling pointer. The calls to printf result in this program having undefined behavior. Identify all of the statements that are true: A : and B : and and C : D : and E : and Question : Recall that in C
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
