Generic Bubble Sort in C/C++
template <class T> void Bubble(T *Array, int size){ int temp; int counter=1; while(counter){ counter=0; for(int i=0; i<(size-1); i++){ if(Array[i]>Array[i+1]){ counter=1; temp=Array[i]; Array[i]=Array[i+1]; Array[i+1]=temp; } } } }