Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- //char 1 byte
- //int 4 bytes
- //float 4 bytes
- //double 8 bytes
- //short int 2 bytes
- //long int 8 bytes
- struct mystruct {
- char y; // 1 byte
- int x; // 4 bytes
- int z; // 4 bytes
- short int w; // 2 bytes
- }; // 11 bytes big
- typedef struct mystruct mystruct_t; // I want to call "struct mystruct" as "mystruct_t" instead
- int main () {
- int a;
- struct mystruct my_object1;
- mystruct_t my_object2;
- my_object1.y;// char
- my_object1.x;// int
- my_object1.w;// 2 bytes
- my_object2.y;// char
- my_object2.x;// int
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment