>int array[size];
This won't work in standard C++. Array sizes must be compile time constants, and your size variable is not. If it compiles, you're relying on a compiler extension which isn't good when learning the language.
>bubblesort(array[],size);
The brackets aren't necessary when referring to the array object itself:
bubblesort(array, size);
Also, swap and bubblesort don't return a value but are defined to return int. And your bubblesort has a bug that will cause an infinite loop. You used = where == was intended.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
bubblesort(array[],size);
to bubblesort(array,size);
pseudorandom21
Practically a Posting Shark
890 posts since Jan 2011
Reputation Points: 216
Solved Threads: 111
the other half doesn't show anything
That's because you're caught in an infinite loop. :icon_rolleyes:and also i don't understand what you mean by
>" You used = where == was intended.">while(swapped=true){
should be
while(swapped==true){
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401