-
What will be the output of the following C code?
#include <stdio.h>
struct Option
{
int t1;
int t2;
};
void fun(struct Option*);
int main()
{
struct Option opt1[] = {12, 22, 23, 24, 25};
fun(opt1);
}
void fun(struct Option opt[])
{
printf("%d %d\n", opt->t1, (opt + 2)->t2);
}
-
- 12 0
- Compilation Error
- 12 garbage value
- Nothing
- undefined behaviour
Correct Option: A
12 0