Question: 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;

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!