Examveda

What will be the output of the following C code?
#include<stdio.h>
#include<stdlib.h>
void main()
{
    char *p = calloc(100, 1);
    p = "welcome";
    printf("%s\n", p);
}

A. error

B. welcome

C. memory location stored by the pointer

D. junk value

Answer: Option B


This Question Belongs to C Program >> Memory Allocation

Join The Discussion

Related Questions on Memory Allocation