Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2: Struct and Union What is the size of the following data structures in bytes. a) Size of point3D (2 pts) struct point3D {

Question 2: Struct and Union

What is the size of the following data structures in bytes.

a) Size of point3D (2 pts)

struct point3D {

signed short x;

unsigned int y;

char *z;

};

b) Size of val (2 pts)

union val {

long long llval;

char str;

short ival[2];

float fval;

double dval;

};

c) Size of compound (2 pts)

struct compound {

char mystring;

long *y;

union {

char *c;

short i;

char f;

} u;

};

d) Size of more_compound (2 pts)

struct more_compound {

char name;

int *age;

short pay;

long height;

union {

char short_id;

short normal_id;

char my_id;

} id;

union {

char *text_data;

int *numeric_data;

long *l_numeric_data;

} data;

};

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Understanding Conflict Conflict Triggers

Answered: 1 week ago