EC327 2009 HW3

EC327 2009 HW3 - 0x20002b28. Please do not simply compile...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
EC327 Introduction to Software Engineering HW #3 – Due Monday Oct. 19, 2009 Name: ___________________ BUID: ___________________ Homework guidelines: You are expected to do individual work on homework assignments. Homework should be handed in during class on the due date. Please use extra sheets as necessary and staple them to this grading sheet. Problems 1-4 [50 total] Problems 1 [10 pts.], 3 [10 pts.], 6 [10 pts.], 16 [20 pts.] of Chapter 6 Problem 5 [50 total] In the following C program, what are the corresponding values for myVar, myPtr, and *myPtr? Assume that malloc returns an address of 0x20002c28 and myVar is located at
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 0x20002b28. Please do not simply compile and run this code to get the answers, you can (and should) use your own example code to fortify your understand of pointers and see why things are the way they are, but ultimately you should use your own understanding of pointers to come up with the values for this assignment: unsigned long myVar; unsigned long* myPtr; int main() { myVar = 0x1234; myPtr = malloc ( sizeof ( long )); // Step 1 *myPtr = myVar; // Step 2 myVar = 0xABCD; // Step 3 myPtr = &myVar; // Step 4 myVar = myVar << 4; // Step 5 (*myPtr)++; myPtr++; // Step 6 } Step myVar myPtr *myPtr 1 2 3 4 5 6 Score:_______...
View Full Document

This note was uploaded on 11/09/2010 for the course ECE 327 taught by Professor Babakkia during the Fall '09 term at BU.

Ask a homework question - tutors are online