Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please help with the following: - For the following questions, assume that the size of an nt' is 4 bytes, the size of a 'char'
please help with the following:
- For the following questions, assume that the size of an nt' is 4 bytes, the size of a 'char' is one byte, the size of a 'float' is 4 bytes and the size of a 'double is 8 bytes. Write the size of the following expressions struct my coord int x, int y double altitude; struct my_line struct my_coord first; struct my_coord second char name [10] struct my_coord var struct my_coord array[3] struct my_line one_line; struct my_line two1ines [2]: sizeof (struct my_coord) sizeof (var) sizeof (array [1]) sizeof (array [2]) sizeof (array) sizeof (struct my_line) sizeof (two_lines) sizeof (one line) -Draw the memory layout of the prior four variables; var, array, one_1ine, and two_lines on a line of boxes. Label the start of each variable and clearly show how many bytes each element within each structure variable consumes. - Re-define the two_lines variable above and initialize it's contents with the following values: first my_line structure first my_coord structure: y 3 altitude 5.6 second my_coord structure: x=4 altitude 2.1 name "My Town" second my_line structure first my_coord structure: altitude 1.1 second my_coord structure: y 3 altitude 0.1 name"Your Town" How many bytes large is the following definition? struct my_coord new_arrayll0,0,3.5 ). ( 1.2,4.5) 2,0,9.5)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started