
#include <stdio.h>

#define MAXSTUDENTS 100

typedef struct {
	int id;
	char name[6];
	double grade;
} student;


int main(int argc, char **argv){

	student s1={1,"ge",3};
	student *p1=&s1;
	printf("Address of s1:%p\n",p1);
	printf("Address of s1.id:%p\n",&s1.id);
	printf("Address of s1.name:%p\n",&s1.name); //because of the padding and the fact that
	// the name has only two bytes, the arrangement of name will be larger to optimize memory access
	printf("Address of s1.grade:%p\n",&s1.grade);
	
	char nameout[2]; 
	int idout;
	double gradeout;

	printf("total size of struct:%lu\n",sizeof(s1));
	
	printf("total size of individual elements:\nid: %lu \nname: %lu\ngrade:%lu\n",sizeof(idout),sizeof(nameout),sizeof(gradeout));

	

   printf("array=%p : &array=%p\n", s1.name, &s1.name);  
  
   printf("array+1 = %p : &array + 1 = %p\n", s1.name+1, &s1.name+1);

}