Quicksort for a pseudosite
Only small/minor issues:


Since code it to be portable to C with minor mods, suggest demarcating that which is sort code from test code.  Its appears the sort code is only these 3.  Do not mix test code with the application code.  Better in separate files.

void quickSort( int a[], int first, int last ) 
int pivot(int a[], int first, int last) 
void swap(int&amp; a, int&amp; b)

pivot(), swap() should be static functions.  No need for them outside this file.
Minor: int vs. size_t.  An int index may lack sufficient range to index an array.  Use size_t as that is Goldilocks type neither to narrow nor wide a type to handle all array sizes - it is just right.  As size_t is some unsigned type, watch out for attempting to create negative values.  I did not notice any issue for your code concerning that.

// int N = sizeof(test)/sizeof(int);
size_t N = sizeof(test)/sizeof(int);

// void quickSort( int a[], int first, int last )
void quickSort( int a[], size_t first, size_t last )

// int pivot(int a[], int first, int last) 
size_t pivot(int a[], size_t first, size_t last) 

The sort would works well with other types beside int.   Perhaps code that way.

typedef int sort_type;     
void quickSort(sort_type a[], size_t first, size_t last ) 

Function signature: Rather than oblige the calling code to supply 0, n-1, create a top level call:

void quickSortTop(sort_type a[], size_t size) {
  if (size) quickSort(a, 0, size-1);
}

Minor: Keep local variables as local as able.  pivotElement could be declared and initialized in 1 step local to the if() block as it is not used outside the block.  This borders on style issues, but as a rule, limiting variable scope is easier to see its use and impact.

int pivotElement;  // here 
if(first &lt; last) {
    int pivotElement = pivot(a, first, last); // or here
    quickSort(a, first, pivotElement-1);
    quickSort(a, pivotElement+1, last);
}

Minor: Correct comment?  I would think to reverse the order a &gt;= would be needed.  If this is not so, then I would expect &lt; to work slightly faster than &lt;=.

/* If you want to sort the list in the other order, change "&lt;=" to "&gt;" */
/* If you want to sort the list in the other order, change "&lt;=" to "&gt;=" */

Minor: Dead code swapNoTemp().  No explanation for its existance here.