Computers and Technology

A class called Pair has already been declared, but the constructors have not been implemented yet. Pair has two public member variables: int *pa,*pb;
These two "pointers to int" are intended to point to heap memory locations that store integers. The remainder of the Pair class expects the following functionality.
A single constructor Pair(int a, int b): This should set up pa and pb to point to newly allocated memory locations on the heap. The integers at those memory locations should be assigned values according to the constructor's integer arguments a and b.
A copy constructor Pair(const Pair& other): This takes as its argument a read-only reference to another Pair. It should set up the newly constructed Pair as a "deep copy," that is, it should create a new Pair that is equivalent to the other Pair based on dereferenced values but does not reuse any of the same memory locations. In other words, the copy constructor should set up its own instance's member variables pa and pb to point to newly allocated memory locations for integers on the heap; those memory locations must be new, not the same locations pointed to by the other Pair, but the integers at these new locations should be assigned values according to the integers that the other Pair is pointing to.
A destructor ~Pair() that de-allocates all of the the heap memory that had previously been allocated for this Pair's members.
The types of these member functions have already been declared in the declaration of Pair. Now you need to provide the implementation of each of these three member functions.
(Note: The function declarations shown in the code comment below do not include parameter names for the arguments. They show only the types of the arguments. This is allowed for a declaration, but when you define the implementation of those functions, you should give names to the parameters so that you can refer to them.)

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:40, hussain34
Mary's manager told her she should insert a graphic into her documentwrite mary a brief note describing how to insert a graphicin a word processing document.
Answers: 1
image
Computers and Technology, 22.06.2019 17:00, Dweath50
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server. so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
image
Computers and Technology, 22.06.2019 23:00, nicog94
In which part of a professional email should you try to be brief, but highly descriptive?
Answers: 1
image
Computers and Technology, 23.06.2019 00:00, eguzmandpandoracom
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
Do you know the correct answer?
A class called Pair has already been declared, but the constructors have not been implemented yet. P...

Questions in other subjects:

Konu
Mathematics, 26.12.2019 01:31
Konu
Mathematics, 26.12.2019 01:31
Konu
Chemistry, 26.12.2019 01:31