help with my bubble sorting of arrays

This is a discussion on help with my bubble sorting of arrays within the C Programming forums, part of the General Programming Boards category; Hi, I really need help with my bubble sorting code, i know the bubble sort is not a good one ...

help with my bubble sorting of arrays

Hi, I really need help with my bubble sorting code, i know the bubble sort is not a good one but i'm a beginner to this.
if anyone can get the code to actually sort the code or at least tell me how to change the code so it works, it's my assignment which has to be next week sometime.. help
#include<stdio.h>
void datain(int, int[10000][4]);
void dataout(int, int[10000][4]);
void sortid( int, int[10000][4], int);
void main()

{
int down, person[10000][4];

/*choose the size of table required*/
printf("Please enter the amount of the people required: \n\r");
scanf("%d",&down);
printf("Amount of people required: %d\n\r",down);

2 - array indices in C start at 0; in this case you keep referencing things like person[array1][4], which doesn't exist.

3a - void sortid( int, int[10000][4], int); is declared (and called upon in the program), but the function you supply is void sort( int number, int person[10000][1], int array): wrong name and the "1" should be "4" (?)

3b - sortid has only INPUT parameters and no pointers or return value, so it can only "communicate" through global variables. You should change the declaration, for example: void sortid( int number, int *(person[4]), int array);, and change the body of the function accordingly.

3c - your datain function has the same problem

4 - you need two loops to implement the bubble sort algorithm.

5 - you sort by exchanging elements of the array (of arrays) person... You should also exchange the satellite data (i.e. keep ID, sex, wage and age together).