I have been working on this assignment, and it says i have to sort a 2d record array based on the type of record so if its an id its an int and if a name its a string, my problem is when i begin using my bubble sort, it seems to not save the previous Array so it does not sort or anything. The Search(RecordArray,temp,n,i) is a function that finds the comma and gets all values before it to compare later on.
This is just my bubble sort. Thanks in advance.
for (int i=1;i<length;i++)
{
char temp1[100]="";
char temp2[100]="";
Search(RecordArray,temp1,n,i);
Search(RecordArray,temp2,n,i+1);
int x,z;
x=atoi(temp1);
z=atoi(temp2);
if(x>z)
{
char *y=&RecordArray[i][256];
RecordArray[i][256]=RecordArray[i+1][256];
RecordArray[i+1][256]=*y;
}
}