Bubblesort implementation in C++
Performance of your implementation is \$\Theta(N^2)\$ in all cases. You can improve it by holding a boolean variable indicating whether the current pass over the array swapped at least once the neighbouring array components. If the boolean is false, the array is sorted and we can exit the sort:

void bubbleSort(int a[], int s) {
    for (int i = 1; i &lt; s; i++) {
        bool swapped = false;

        for (int j = 0; j &lt; s - i; j++) {
            if (a[j] &gt; a[j + 1]) {
                std::swap(a[j], a[j + 1]);
                swapped = true;
            }
        }

        if (!swapped) {
            return;
        }
    }
}


The above alternative implementation runs in linear time on almost sorted arrays.

Also, as you can see above, #include &lt;utility&gt; offers you a swapping routine (std::swap); why not use it?

Hope that helps.