Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
struct Card {
   char ch;
   int val;
};
void quickSort(Card[] a, int left, int right, bool exchanged, bool& stable) {
   if (left >= right) {
       return;
   }
   int mid = part(a, left, right, origIndex, stable);
   quickSort(a, left, mid - 1, false, stable);
   quickSort(a, mid + 1, right, true, stable);
}
int part(Card[] a, int left, int right, bool exchanged, bool& stable) {
   int pivot = right;
   int cur = left - 1;
   for (int i = left ; i <= right - 1; i ++) {   
      if (a[i].val <= a[pivot].val) {
         if (a[i].val == a[pivot].val && exchanged) {
            stable = false;
         }
         cur ++;
         swap(a[i], a[cur]);
      }
   }
   swap(a[pivot], a[cur + 1]);
   return cur + 1;
}
int main () {
   int n;
   cin >> n;
   Card a[n];
   for (int i = 0; i < n; i ++) {
       cin >> a[i].ch >> a[i].val;
   }
   bool stable = true;
   quickSort(a, 0, n - 1, false, stable);
   if (stable) {
       cout << "Stable\n";
   }
   else{
       cout << "Not Stable\n";
   }
   for (int i = 0; i < n ; i ++) {
       cout << a[i].ch << a[i].val << endl;
   }
}

Compiler output:
a.cc:8:23: error: expected ',' or '...' before 'a'
    8 | void quickSort(Card[] a, int left, int right, bool exchanged, bool& stable) {
      |                       ^
a.cc: In function 'void quickSort(Card*)':
a.cc:12:19: error: 'a' was not declared in this scope
   12 |    int mid = part(a, left, right, origIndex, stable);
      |                   ^
a.cc:12:35: error: 'origIndex' was not declared in this scope
   12 |    int mid = part(a, left, right, origIndex, stable);
      |                                   ^~~~~~~~~
a.cc:12:46: error: 'stable' was not declared in this scope; did you mean 'mutable'?
   12 |    int mid = part(a, left, right, origIndex, stable);
      |                                              ^~~~~~
      |                                              mutable
a.cc:12:14: error: 'part' was not declared in this scope
   12 |    int mid = part(a, left, right, origIndex, stable);
      |              ^~~~
a.cc: At global scope:
a.cc:16:17: error: expected ',' or '...' before 'a'
   16 | int part(Card[] a, int left, int right, bool exchanged, bool& stable) {
      |                 ^
a.cc: In function 'int part(Card*)':
a.cc:17:16: error: invalid conversion from 'std::ios_base& (*)(std::ios_base&)' to 'int' [-fpermissive]
   17 |    int pivot = right;
      |                ^~~~~
      |                |
      |                std::ios_base& (*)(std::ios_base&)
a.cc:18:19: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   18 |    int cur = left - 1;
      |              ~~~~~^~~
a.cc:18:19: error: invalid conversion from 'std::ios_base& (*)(std::ios_base&)' to 'int' [-fpermissive]
   18 |    int cur = left - 1;
      |              ~~~~~^~~
      |                   |
      |                   std::ios_base& (*)(std::ios_base&)
a.cc:19:17: error: invalid conversion from 'std::ios_base& (*)(std::ios_base&)' to 'int' [-fpermissive]
   19 |    for (int i = left ; i <= right - 1; i ++) {
      |                 ^~~~
      |                 |
      |                 std::ios_base& (*)(std::ios_base&)
a.cc:19:35: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   19 |    for (int i = left ; i <= right - 1; i ++) {
      |                             ~~~~~~^~~
a.cc:19:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |    for (int i = left ; i <= right - 1; i ++) {
      |                        ~~^~~~~~~~~~~~
a.cc:20:11: error: 'a' was not declared in this scope
   20 |       if (a[i].val <= a[pivot].val) {
      |           ^
a.cc:21:42: error: 'exchanged' was not declared in this scope
   21 |          if (a[i].val == a[pivot].val && exchanged) {
      |                                          ^~~~~~~~~
a.cc:22:13: error: 'stable' was not declared in this scope; did you mean 'mutable'?
   22 |             stable = false;
      |             ^~~~~~
      |             mutable
a.cc:28:9: error: 'a' was not declared in this scope
   28 |    swap(a[pivot], a[cur + 1]);
      |         ^
a.cc: In function 'int main()':
a.cc:39:13: error: too many arguments to function 'void quickSort(Card*)'
   39 |    quickSort(a, 0, n - 1, false, stable);
      |    ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:8:6: note: declared here
    8 | void quickSort(Card[] a, int left, int right, bool exchanged, bool& stable) {
      |      ^~~~~~~~~