Answered step by step
Verified Expert Solution
Question
1 Approved Answer
AC data structure is declared thus: struct datum ( }; long key; int metrica[4]; unsigned short source_port; unsigned short dest_port; a. Draw a figure
AC data structure is declared thus: struct datum ( }; long key; int metrica[4]; unsigned short source_port; unsigned short dest_port; a. Draw a figure showing the layout of this structure in memory, like the ones shown in lecture. Label each section of memory with the name of the field and its size in bytes. (Ascii art is OK.) b. A variable is declared like this: struct datum aDatum; The compiler places the variable at address 0x10000. What is the starting address of the field aDatum.source_port? You may answer in decimal or hex, but indicate which! c. What is the address of aDatum. metrics [2]? d. Suppose an array is declared: struct datum info [10]. How many bytes would this array occupy in total? (Hint: remember alignment requirements.)
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