0
I need help in making a linked list of vehicle structs
Just like the title suggests, I need help on making a linked list of vehicle structs. Nothing that I'm able to find can actually help me nor can I understand what they're doing. Desperately need this for a college project
2 Answers
+ 1
This is how they want me to do it:
- Each vehicle should have a Make, Model, Registration Number, Mileage/Kmâs and Number
of previous owners.
- Once a vehicle is bought or sold, the user should be able to add/insert or delete a vehicle as necessary and then print out a full list of remaining available vehicles in stock.
- Vehicle struct details such as a Make, Model, Registration Number, Mileage and previous owners should be pointers to memory which you allocate via malloc
- Requests to enter data for each new candidate should be in an âinsertâ function rather than the main program (unlike the linked list example on moodle) and deletion should be using a âdeleteâ function. Printing the list should be using a print function.
- Vehicles should be inserted in alphabetical order of the first letter of their model. Therefore, a separate function called from within the âinsertâ function should check for this and return whether the newly inserted candidate should go before or after the current link. (i.e. Civics should be printed out before Golfs)
0
Yeah, a list of vehicles. I'll send the actual thing they want me to do