subject

Implement the initializeMemory() function. You can pass these unit tests by simply initializing the member variables with the parameters given to this function. However, you also need to dynamically allocate an array of
integers in this function that will serve as the memory storage for the simulation. If you are a bit rusty on dynamic
memory allocation, basically you need to do the following. There is already a member variable named memory
in this class. Memory is a type int* (a pointer to an integer) defined for our
class. If you know how much memory you need to allocate, you can simply use the new keyword to allocate a
block / array of memory, doing something like the following
memory = new int[memorySize];

void ::initializeMemory(int memoryBaseAddress, int memoryBoundsAddress)
{
// initializeMemory steps
// 1. set the base, bounds and size member variables
// 2.0 if memory is already allocated, free it up first. This is because we
// can reuse a simulation many times, thus we should free past old memory
// before allocating a new block of memory
// 2.1 allocate a new array into the memory member variable of the correct
// size to hold requested memory e. g. memory = new int[memorySize];
// 3. you should ensure that all of of memory is initialized to 0

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 14:00, camiserjai1832
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
image
Computers and Technology, 23.06.2019 18:30, janny48
How often does colleges update the cost of attendance on their website? . a)every two years b) every four years c) every year d) every semester
Answers: 1
image
Computers and Technology, 23.06.2019 20:30, batmandillon21
1. for which of the following are you not required to signal beforehand? a. changing lanes b. speeding up c. stopping
Answers: 2
image
Computers and Technology, 24.06.2019 10:50, latresyn
In 2009 to 2010, how many social network users were reported as being victims of online abuse? a. 1 in 10 b. 100% c.1 in 100 d. 50%
Answers: 2
You know the right answer?
Implement the initializeMemory() function. You can pass these unit tests by simply initializing the...

Questions in other subjects:

Konu
Physics, 01.11.2020 14:00