Examveda
Examveda

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char *str = "hello, world!!\n";
    char strc[] = "good morning\n";
    strcpy(strc, str);
    printf("%s\n", strc);
    return 0;
}

A. hello, world!!

B. Compile time error

C. Undefined behaviour

D. Segmenation fault

Answer: Option C


This Question Belongs to C Program >> Pointer

Join The Discussion

Related Questions on Pointer