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;
}
#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
Join The Discussion