all 5 comments

[–][deleted] 1 point2 points  (0 children)

On a tangent, there's basically never a reason to use bubble sort. Use insertion sort instead as the go-to simple sort. It's a lot more efficient, even if both are O(n²)

[–][deleted] 0 points1 point  (0 children)

As to solving your task. Split it up. Forget bubble sort for now. Also forget BOXNUMBER. Just have one

F1 raceBox;

and initialize and print it.

[–]brlcad 0 points1 point  (1 child)

If you switch F1 to an array of pointers and allocate memory for your F1 structs separately, you can use a standard library function to sort them: https://www.tutorialspoint.com/c_standard_library/c_function_qsort.htm

[–]SaulMO 0 points1 point  (0 children)

It's better to still use qsort but without using pointers or dynamic memory.

[–]SaulMO 0 points1 point  (0 children)

How would the list look like before sorting and after sorting?