Consider the following C code snippet: int *p: int l = p, k: k = realloc(p, 2 * sizeof (char)): printf (“%d”, k): is the code segment correct or error. If correct what is the output? a) Garbage value b) Address of K c) Error d) None of the above a b c d
Expert Answer
Answer is A
Because it initialiseing the value from realloc but it can’t set any value so it will print Garbage value.