Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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. 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
Step: 1
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...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