Need help? We are here

In this question, you are going to assume the following

 In this question, you are going to assume the following data type and its corresponding sizes: char: 1 byte and int: 3 bytes. From a C-like snippet of a code below, answer the rest of this questions. Note: use a lost of casting in the second half of this snippet to make sure things are clearly declared. typedef struct type1{int i[3];} typeA; typedef struct type2{typeA j[2];} typeB; typeA *a; typeB *b; unsigned long *c; int i; a = malloc(2*sizeof(typeB)); b = a; c = a; for(i=0;i<18;i++) { *(c+i) = (unsigned char)(i%8); } Assuming that the actual location of a after malloc is called is at the physical address 0x10000 in DRAM. Using the concept of address we learn from our class, the table below shows our DRAM starting from the address 0x10000. Please put in the values inside each bytes in our DRAM starting at address 0x10000 up to the end of where a is malloced for. Write XX in the byte that is unknown/unassigned, and write YY on the byte that is not in the range that a covers. I gave you the first byte, finish the rest. Hint: Draw the organization of the struct out on a piece of paper. Pair this up with the concept of an array and type casting. This question is actually very easy but you need to be a bit careful. Hint2: Please note that our table is actually 1D. Each row is 8 bytes in size and the address of the next row basically continue from the end of the earlier row. I just have no method to draw a very long 1D table so I need to resort to a 2D table here. 

Table of Contents

Calculate your order
Pages (275 words)
Standard price: $0.00

Latest Reviews

Impressed with the sample above? Wait there is more

Related Questions

Write a brief essay

ASSIGNMENT 1 Write a brief essay (300-500 words or so) about a current news story that interests you in some way. In your essay, describe the

An expository essay – Premium Paper Help

Premium Paper Help is a professional writing service that provides original papers. Our products include academic papers of varying complexity and other personalized services, along

Angina and the treatment options

Describe the pathophysiology (cause, progression and outcome) of Angina. Include in your answer risk factors for Angina and the treatment options for Angina. Demonstrate links

New questions

Don't Let Questions or Concerns Hold You Back - Make a Free Inquiry Now!