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

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 14:30
The egyptians invented the ? to water their crops, and may have used the ? to build the pyramids.
Answers: 1
question
Computers and Technology, 24.06.2019 02:30
How to apply the fly in effect to objects on a slide
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
question
Computers and Technology, 24.06.2019 16:50
How many types of string types does python support?
Answers: 1
You know the right answer?
Implement the initializeMemory() function. You can pass these unit tests by simply initializing the...
Questions
question
Mathematics, 12.08.2020 05:01
question
Mathematics, 12.08.2020 05:01
question
Mathematics, 12.08.2020 05:01
question
Mathematics, 12.08.2020 05:01
question
Mathematics, 12.08.2020 05:01
question
Mathematics, 12.08.2020 05:01
Questions on the website: 13722362