AD1

Thursday, 19 January 2017

Structures

In the following code , assume that the base address of the structure is 2424384 (in decimal form) , what will be the output of the program 

#include <stdio.h>
int main()
{
struct employee {int age;float salary;};
struct employee e1={40,3000};
struct employee *pointer_to_e=&e1;
printf("%d\n%d\n%d\n%d",pointer_to_e,&(e1.age),&(e1.salary),(pointer_to_e)+1);
return 0;
}
view raw struct.c hosted with ❤ by GitHub
Solution
2424384
2424384
2424388
2424392

No comments:

Post a Comment