Vidyalelo
C Programming · Q37

Memory Allocation

Programming · C Programming · question 37

Q37

What will be the output of the following C code? #include #include void main() char *p = calloc(100, 1); p = "welcome"; printf("%s ", p);

A.
error
B.
welcome
Answer
C.
memory location stored by the pointer
D.
junk value

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board