Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Main function will be responsible for getting the number of elements from the user. Then it will call the AllocArray function which will allocate a

image text in transcribed

Main function will be responsible for getting the number of elements from the user. Then it will call the AllocArray function which will allocate a block space of memory (dynamic) and return the address of the location and store it to a pointer. It will then call the function InitArray which will prompt the user to fill the array with integer values. After, main will call the DispArray function to display the array the user entered. Then main will call the SortArray function, which will sort the array from least to greatest. Another call to DispArray will be made to show the updated results. Main should take care of releasing the memory allocated. Main function should be written in its own file called main.cpp The functions below should be written in a file called DynMem.cpp AllocArray will accept as argument an int value that has the number of elements the user desires. It will allocate a block space of memory and return thee address. InitArray will accept as argument an int pointer and an int value of the number of elements. It will prompt the user to enter a value to fill the array. It will return nothing. DispArray will accept as argument an int pointer and an int value of the number of elements. It will display the array to the monitor. It will return nothing. SortArray will accept as argument an int pointer and an int value of the number of elements. It will sort the contents of the array from least to greatest. It will return nothing Create a file called DynMem.h where you will only place the function prototypes As usual, make sure you're clear on how information is getting passed around before writing any code. An excellent way to get started is to first sketch out the program with a structure chart, that way you'll have a better idea of the function call hierarchy, as well as the data flow among the functions. You can save your code in the Hw19 subdirectory with the files main.cpp DynMem.cpp, and DynMem.h. Good luck! 10:27 AM ^ ) 11/13/2018

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions