-
What will be the output of the following C code?
#include <stdio.h>
struct Count
{
int m;
int n;
};
void fun(struct Count*);
int main()
{
struct Count c1[] = {14, 24, 34, 44, 54};
fun(c1);
}
void fun(struct Count c2[])
{
printf("%d %d\n", c2->m, (c2 + 2).n);
}
-
- 24
- 34
- 44
- 54
- Compilation Error
Correct Option: E
Compilation Error
main.c: In function ‘fun’:
main.c:15:42: error: ‘c2 + 16’ is a pointer; did you mean to use ‘->’?
printf("%d %d\n", c2->m, (c2 + 2).n);