char BubbleSort(char Names [], int NumElements);
int main()
{
constint MaxNames(20);
constint MaxLetters(15);
char Names [MaxNames + 1] [MaxLetters + 1];
int NumRows;
int Row;
int Col;
int NumCols = MaxLetters;
int x;
int y;
cout << "How many names shall you enter?" << endl;
NumRows = ReadInteger ();
cout << "Enter " << NumRows << " names: " << endl;
for (Row = 0; Row < NumRows; Row++)
{
cin.getline (Names [Row], MaxLetters + 1, '\n');
}
cout << "You entered " << endl;
for (Row = 0; Row < NumRows; Row++)
{
cout << Names[Row];
cout << endl;
}
for (x = 0; x < NumRows; x++)
{
BubbleSort (Names [] [NumCols], NumRows);
}
}
NumElements)
{
int i;
bool Sorted;
char Temp;
do {
Sorted = true;
NumElements--;
i++;
strcmp (Names[i], Names[i + 1]);
if (Names [i] > Names [i + 1])
{
Sorted = false;
strcpy(Names[i], Names[i + 1]);
}
else;
} while (!Sorted);
return (Names[i], NumElements);
}
Also, you cannot return an array nor can you loop a return statement: return (Names[i], NumElements);. You would have to store the result and return a single variable.