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, 22.06.2019 18:30
Which of the following commands is more recommended while creating a bot?
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
Three out of five seniors remain undecided about a college major at the end of their senior year.
Answers: 3
question
Computers and Technology, 23.06.2019 11:00
What are the possible consequences of computer hacking? what is computer piracy? describe some examples. what are the effects of computer piracy? what are the possible consequences of computer piracy? what is intentional virus setting? describe some examples. what are the effects of intentional virus setting? what are the possible consequences of intentional virus setting? what is invasion of privacy? describe some examples. what are the effects of invasion of privacy? what are the possible consequences of invasion of privacy? what is an acceptable use policy and what is the purpose of the acceptable use policy what is intellectual property and how can you use it?
Answers: 1
question
Computers and Technology, 23.06.2019 11:50
While preforming before operation pmcs, you notice the front right tire appears slightly under-inflated. what is the proper action?
Answers: 3
You know the right answer?
Implement the initializeMemory() function. You can pass these unit tests by simply initializing the...
Questions
question
Chemistry, 13.01.2021 19:00
question
Mathematics, 13.01.2021 19:00
question
SAT, 13.01.2021 19:00
Questions on the website: 13722367