0

Can you help me to fixed this problem please đŸ„ș

#include <iostream> using namespace std; void sortArray(int array[], int size); int main(void) { char letters[10]; // an array of 10 char char lastLet; char symbol; for (int i = 0; i < 10; i++) { cout << "Enter 19 character " << (i + 1) << ": "; cin >> letters[i]; } cout << "Array input complete." << endl; sortArray[10](Letters, 10); for (int i = 0; i < 10; i++) { if (lastLet != letters[i]) { cout << letters[i] << endl; lastLet = letters[i]; } } cout << "Array display complete." << endl; cin >> symbol; } // ############################### void sortArray(int array[], int size) // C++ passes arrays by reference { int temp; for (int i = 0; i < size; i++) // loop through the entire array { for (int j = i; j < size; j++) // loop through the item being checked until the end { if (array[j] < array[i]) // if the item being che

7th Jun 2021, 10:46 PM
kindy genardino
2 Answers
+ 3
Place your code in the Code Playground, save it as public, and share link here. It will be much easier to tell what's wrong. At first glance, I can see "sortArray[10]" as a mistake. sortArray is function, so it has no indexes
7th Jun 2021, 11:27 PM
Michal Doruch