Question: 2. What is word alignment? When is it important? class biff { } short int a; long int b; short int c; 3. Looking

   2. What is word alignment? When is it important? class biff { } short int a; long int b; short int c; 3. 

2. What is word alignment? When is it important? class biff { } short int a; long int b; short int c; 3. Looking at the class biff above, how many bytes would it occupy if a short int uses 2 bytes and a long int uses 4 bytes (Assume no word alignment). Now, assuming word alignment comes into play, how bytes would biff need. If possible, rearrange biff so that it occupies less space. 4. In general, what do the "*" and "&" operators do in C/C++ when used for memory addressing? 5. In the following cases, what do the following operators in C/C++ do in regards to memory referencing. ((*)) a. as in: int *myPtr; b. "*" as in: *myPtr = 4; c. "&" as in: myPtr = &x; d. "&" as in: myPtr = &(x[0]); (where x is an array defined as: int x[10];) 6. Write out some code (by hand) that will declare and load an array of integers using conventional array accessing methods. Let the array have 10 elements. 7. Now, using memory pointers, write out some code (by hand) that will declare and load an array of integers. Let the array have 10 elements. 8. Why is the method using memory pointers more computationally efficient?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The image youve provided contains a list of questions related to programming concepts in CC Lets go through them step by step 2 What is word alignment When is it important Word alignment is the practi... View full answer

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!