Question: **C++ 1. Create a static array called myArray which will hold 100 integers. Create another static array called myArray2 which will hold 200 integers. Also

**C++

1. Create a static array called myArray which will hold 100 integers. Create another static array called myArray2 which will hold 200 integers. Also create an integer pointer called myPointer. Static means you will not use the new function call. Your code will then:

a. Fill both arrays with numbers 0 to 99 for myArray, and 100 to 299 for myArray2.

b. Display the addresses (memory locations) of myArray [0] and myArray[99]

c. Display the difference between these two numbers.

d. Question: Subtract the two original memory locations by hand. Is this the correct amount of memory to be used for this array? Explain any differences.

e. Make myPointer point to location 100 in myArray2.

f. Copy all values starting from myPointer to myArray such that it fills it up with the values. Thus, myArray should end up holding values 200 to 299. You may not use array notation such as myPointer[0], but you must dereference variations to myPointer such as *myPointer or *(myPointer + something)

g. Display all the values in myArray separated by a space.

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 Databases Questions!