Lab 6
Lab 6
Solution # 01
S:1
int getNameCount()
{
std::cout << "How many names would you like to enter? ";
int length{};
std::cin >> length;
return length;
}
int main()
{
int length{ getNameCount() };
getNames(names, length);
// Sort the array
std::sort(names, names + length);
printNames(names, length);
return 0;
}
Solution # 02
S2:
#include<iostream>
using namespace std;
int main()
{
int size, i;
int* ptr;
delete[] ptr;
//deallocating all the memory created by new operator
return 0;
}