hmmmm...i'm really lost, i have no idea how to sort this info using a bubble sort heres the complete code if anyone has any ideas, please let me know
#include <stdio.h>
struct cars{
...
Type: Posts; User: ManicC
hmmmm...i'm really lost, i have no idea how to sort this info using a bubble sort heres the complete code if anyone has any ideas, please let me know
#include <stdio.h>
struct cars{
...
sure
struct cars{
char make[20];
char model[20];
char color[20];
int year;
int price;
}inven[50];
ok the problem is with the bubble sort itself
this is what i have now
void sort_make(struct cars *inven, int number){
int i, j;
for(j = number; j > number ; j--){
for(i...
thanks, so what's the syntax for passing from the bubble sort to the swap function? i just want to compare and sort a string element of a structure?
well lets say that you wanted to pass in 10 numbers entered by the user, you would have to work through the array using a for loop.
example:
void read_array(int *array) /*Reads in the...
ok here's the problem i have this swap function that was created for a previous program, and i want to use it for a sort routine (bubble)
struct students temp;
...
Hey thanks a lot C_Coder, i really wasn't expecting that much of a detailed reply. By the way yes, i'm sorting according to make, model, etc. using a bubble sort.
again thanks
--ManicC--
well see that's the problem is i have a lot of code that wasn't even close to right. I'm not asking for anyone to give me code i just needed any ideas as to how i should go about doing this.
this...
ok here's the deal i have to make a prog that ask the user how many cars that they want to enter, then prompt them for the make, model, year, color, price. Then sorts the info anyway the user wants...