How to releasing the memory using the delete operat

Assignment Help Computer Engineering
Reference no: EM1331337

In class, we have been discussing creating objects using the new operator and releasing the memory using the delete operator. Two other similar operators are new[] and delete[]. These operators work the same as the new and delete but with arrays, these are called dynamic arrays:

int size = 5;

// Dynamic arrays don't have to be initialized with constants.

int* ints = new int[size];

// We can rezie the array dynamically.

ints = new int[size];

// Use delete[] to release memory.

delete[] ints;

Create a class Person having the following:

· First name, last name, and middle name with their respective get and set functions. The get functions shall be declared constants.

· A default constructor.

· Overload the operators == and !=. The equality operator shall evaluate to true when the social security numbers are equal. The not equals operator shall evaluate to true when the social security numbers are not equal.

Then use your class Person to create a class RegistrationOffice. This class shall have the following:

· A dynamic array of Person objects. Initially the array will have size 10.

· A function register(Person&). This function will add the specified person to the array. Make sure to check the size of the array and resize it if the array is out of space.

· A function remove(int). This function will search the array for the person having the specified social security and remove it from the array. Make sure to shift the needed elements of the array.

· A function find(int). This function will search the array and return the person having the specified social security.

· A function display(void). This function will display to the screen all the people registered.

· Overload the operator << taking a Person object as parameter. This operator will perform the same logic as register.

· Overload the operator [ ] taking an int as parameter. This operator will perform the same logic as find.

In your driver class, make sure to test all the functions created in both classes.

Reference no: EM1331337

Questions Cloud

Alternative hrm practices : Show one or more conflicting practices you have experienced and recommend one or more alternative HRM practices that could appropriately minimize, or even eliminate, the conflict. Explain in detail.
Elucidate difference among the consumption of a free good : Elucidate the difference among the consumption of a free good and a good that is not free.
What is strategic management : What is strategic management? What role does strategic management play in the hospitality industry?
Elucidate the roles played by total utility : Elucidate the roles played by total utility and marginal utility.
How to releasing the memory using the delete operat : In class, we have been discussing creating objects using the new operator and releasing the memory using the delete operator. Two other similar operators are new[] and delete[]. These operators work the similar as the new and delete but with arrays..
How many shares must the venture capitalist receive : How many shares must the venture capitalist receive to end up with 28% of the company? What is the implied price per share of this funding round?
What are various practical things you could do to raise : As a manager what are various practical things you could do to raise utility for employees that also benefit the firm
Explain about hrm technologies : What were the rationales for choosing these HRM technologies and When were these HRM technologies implemente
Prepare a code of conduct or ethics manual : Developing a Code of Conduct or Ethics Manual - prepare an introduction describing your needs regarding this memo. Develop several questions to complete the content and prepare a closing statement for the person that provides information.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Asynchronous transmission

Assume that the sender and receiver utilize an asynchronous transmission and agree not to utilize any stop elements.

  Compare the role and impact of a computing technology

information on understanding an inner workings of digital downloads and digital compression. I need to follow the outline below. I'm running out of information. I need to compare the role and impact of a computing technology on society.

  What is oracle administration documentations

What is oracle administration documentations

  What will offer as a network suggestion

With true VPN access to basically an Intranet Environment at each office; there really should not be any need for "Routing" per se unless I am missing something. I only have 2 days for this project before I head back to field, so I just need some ..

  Mips single-cycle datapath processor

An instruction is being executed on the MIPS single-cycle datapath processor. Which class of instruction is being executed over the processor? b) Will you specify which instruction is being executing?

  Centralized and distributed data processing

Discuss in detail the difference between the centralized and the distributed data processing.

  Computing the effective address

An instruction is stored at the location 300 along with its address field at the location 301. The address field has value 400. A processor register R1 consists of the number 200.

  Why x3d is currently replacing vrml

X3D is currently replacing VRML as the nearest the internet gets to Virtual Reality currently. Is X3D suited specifically to certain applications over others? consider an application for the Internet where you believe Virtual Reality would be of b..

  How to research the development technologies

how to Research the development technologies below and type up a sum,mary of them.

  Advantages and disadvantages of implementing a dfs

Advantages and disadvantages of implementing a DFS

  The cost of maintenance over a lifetime of a system

What are some of the things management can do to ensure efficient and effective maintenance.

  Create a .plan file using pico/nano

Create a .plan file using PICO/NANO

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd