#include <stdio.h>
#include<stdlib.h>
struct try {
int x,*x_Ptr;
float y,*y_Ptr;
char q,*q_Ptr;
}; //integer, float character variables and their pointers are defined in the structures.
int main (void){
struct try den1;
struct try den2;
struct try den3;
den1.x=7;
den2.x=8;
den1.y=-.14;
den2.y=23.45;
den3.q='A';
den1.x_Ptr=&den1.x; //pointer assignments for integer.
den2.x_Ptr=&den2.x;
den1.y_Ptr=&den1.y; //pointer assignments for float.
den2.y_Ptr=&den2.y;
den3.q_Ptr=&den3.q; //pointer assignments for character.
system("clear");
printf("The integer in den1:%d\nThe integer in den2:%d\nThe address of integer in den1:%p\nThe address of integer in den2:%p\nThe pointer address of integer in den1:%p\nThe pointer address of integer in den2:%p\n",den1.x,den2.x,&den1.x,&den2.x,&*den1.x_Ptr,&*den2.x_Ptr);
printf("\n");
printf("The float in den1:%f\nThe float in den2:%f\nThe address of float in den1:%p\nThe address of float in den2:%p\nThe pointer address of float in den1:%p\nThe pointer address of float in den2:%p\n",den1.y,den2.y,&den1.y,&den2.y,&*den1.y_Ptr,&*den2.y_Ptr);
printf("\n");
printf("The character in den3:%c\nThe address of character in den3:%p\nThe pointer address of character in den3:%p\n",den3.q,&den3.q,&*den3.q_Ptr);
printf("\n");
printf("\nThe whole address of the first struct{...\n...\n...\n...\t\t\t}den1:%p\n",&den1);
printf("\nThe whole address of the second struct{...\n...\n...\n...\t\t\t}den2:%p\n",&den2);
printf("\nThe whole address of the second struct{...\n...\n...\n...\t\t\t}den3:%p\n",&den3);
return 0;
}
Я понял, что адрес одного из целых чисел в структуре и адрес структуры совпадают. В чем причина?