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

  Left most derivation

A->a|aS|bAA, B->b|bS|aBB, For the string “aaabbabbba” determine a Left most derivation.

  What is microprocessor - motorola 68k assembly language

What is microprocessor - Motorola 68k assembly language? Implement your plan using a user vectored interrupt number 3. Use busy line from the printer to trigger the interrupt. The printer interrupt level is 2. Explain the extra hardware to make t..

  Various counter controlled repetitive control structures

Write down the example that demonstrates different techniques of passing arguments: by value, by reference, and as pointers. Discuss the three methods.

  Why systems need to be updated or upgraded

How could a customer relationship management system advance strategies of the payer organization.

  Determining the smallest values in dictionary

Explain an efficient method for determining the k smallest values in the dictionary which are greater than low. Your method must take much less than O (n) time whenever k is much less than n. Analyze the time for your method.

  Preparing the list of tables

In the last board meeting, your supervisor has asked someone to build a list of tables for the Fernandos Skate Shop customer orders.

  Describing lan and wan

Write down in words and describe the meanings of terms LAN and WAN. Explain how do they differ? State three basic topologies for LAN use, and describe the differences among then.

  Mathematics in computing

Write the selection sort algorithm

  D flip-flops

Using three D flip-flops,a multiplexer,decoders and gates, construct a 3-bit Gray code counter that has two inputs: reset, which sets the counter to 000, and inc, which makes the counter go to the next value in the sequence.

  Explain why 802.11b is the first popular standard

the first widely popular standard and still by far most used by IT industry today.

  Write down a program that reads a social security number

Write down a program that reads a social security number written as contiguous digits (for instance, 509435456), uses the charAt method to obtain each character and then prints each digit on a separate line followed by a colon and the digit printe..

  What type of procedures might a company put into place

What are some common steps and what type of procedures might a company put into place.

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