[C++]
Struct SCP used to store information about paranormal objects is declared as below: struct SCP { int id; int objClass; }; string speConProcedures; string description; string* addendums; int numAddendums; SCP Foundation's classified archives are stored as a dynamic allocated array. However, because of some specific reason, the array is not sorted in any order. Implement the function with the following prototype: SCP** sortDatabase (SCP** arr, int n); Where arr is the array of SCP typed pointers, n is the length of the array. The function returns the sorted array in item number (id) increasing order. Note: Libraries iostream and string have been imported, and namespace std has been used.
1 UNP 2 3 T ** SCP* sortDatabase (SCP** arr, int n) { } //TODO
[C++]
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am