Strange Bubble sort behaviour.
- by user271528
Can anyone explain why this bubble sort function doesn't work and why I loose number in my output. I'm very new to C, so please forgive me if this is something very obvious I have missed.
#include <stdio.h>
#include
int bubble(int array[],int length) {
int i, j;
int temp;
for(i = 0; i < (length); ++i) {
for(j = 0; j <…