24 lines
415 B
C
24 lines
415 B
C
// playing around with structs
|
|
// win 2024
|
|
|
|
#include <stdio.h>
|
|
|
|
struct abc {
|
|
int x;
|
|
int y;
|
|
int z;
|
|
};
|
|
|
|
int main() {
|
|
struct abc a = {0, 1, 2};
|
|
struct abc *ptr = &a;
|
|
|
|
printf("Address of struct a: %p\n", ptr);
|
|
|
|
printf("Address of x in struct a: %p\n", &a.x);
|
|
printf("Address of y in struct a: %p\n", &a.y);
|
|
printf("Address of z in struct a: %p:\n", &a.z);
|
|
|
|
return 0;
|
|
}
|