Draw out the way each of these structs looks in memory, including padding! Number the offsets in memory. 1 struct node 2 { 3 node* next; 4 int a; 5 int b; 6 char c, d, e; 7 8 }; node* prev; 1 typedef struct vec4 2 { 3 float x, y, z, w; 4} vec4_t; 1 struct mat4 2 { 3 vec4 v1, v2, v3, v4; 4 } 1 struct goodName 2 { 3 4 567 7 }; char c [8]; int a[2]; double d; short s[4];

icon
Related questions
Question
Draw out the way each of these structs looks in memory, including padding! Number
the offsets in memory.
1
struct node
2 {
3
node* next;
4
int a;
5
int b;
6
char c, d, e;
7
8 };
node* prev;
1 typedef struct vec4
2 {
3
float x, y, z, w;
4} vec4_t;
1
struct mat4
2 {
3
vec4 v1, v2, v3, v4;
4 }
1 struct goodName
2 {
3
4
567
7 };
char c [8];
int a[2];
double d;
short s[4];
Transcribed Image Text:Draw out the way each of these structs looks in memory, including padding! Number the offsets in memory. 1 struct node 2 { 3 node* next; 4 int a; 5 int b; 6 char c, d, e; 7 8 }; node* prev; 1 typedef struct vec4 2 { 3 float x, y, z, w; 4} vec4_t; 1 struct mat4 2 { 3 vec4 v1, v2, v3, v4; 4 } 1 struct goodName 2 { 3 4 567 7 }; char c [8]; int a[2]; double d; short s[4];
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer