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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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