-
What will be the output of the following C code?
#include <stdio.h>
typedef struct Employee
{
char *ch;
}Employ;
void main()
{
struct Employ emp;
emp.ch = "hello";
printf("%s", emp.ch);
}
-
- Compilation Error
- Garbage value
- hello
- Undefined behaviour
- None of these
Correct Option: A
Compilation Error
main.c: In function ‘main’:
main.c:8:23: error: storage size of ‘emp’ isn’t known
struct Employ emp;