Code:
#include <stdio.h>

typedef  struct  cars {
                                          char  make [ 20 ] ;
                                          char  model [ 20 ] ;
                                          char  color  [ 15 ] ;
                                          int  year ;
                                          double price ;
                                      }  cars ; 




//Provide the prototype for your PCFs below:




int main (void)
{
    //Local variables declared... add additional variables as required
    cars  inventory [ 25 ] ;


     //1. Open the cars.dat file in the read mode and confirm
    //     you have properly opened the file.




     //2. Read the entire contents of the cars.dat file into the
     //    inventory array.    




     //3. Close the cars.dat file




     //4. Call function_1( ), which will process the contents of the
     //    inventory array by sorting the inventory array to place all the cars
     //     in ascending order according to their price.




    //5. Call function_2( ), which will save (write) the sorted inventory
    //    array to a file named output.dat
 


    //6. Terminate
    return 0 ;
}


//Provide the definition for your PCFs below:
I can't figure out how to populate the array with the data in the data file. Above is what I have so far. Below is what the data file looks like.

Mazda Miata Blue 2022 22432.32
Dodge Charger Yellow 2021 25649.99
Lexus GX460 Black 2022 62180.00
Audi SQ5 Yellow 2022 63274.00
Lexus GS350 Yellow 2022 56107.44
Volkswagen Touareg Green 2022 57139.65
Lexus RX450H Silver 2022 57687.62
Mercedes ML-Class Black 2022 63566.99
Audi A6 Yellow 2022 60846.22
Audi Q7 Brown 2022 62208.41
BMW 4-Series Blue 2022 57560.00
Ford F-150 White 2022 62035.00
Chevrolet Corvette Blue 2022 68200.00
Toyota Tundra Gray 2022 60320.00
Chevrolet Suburban White 2022 67000.00
Audi A8L Yellow 2020 75234.00
Audi R8 Red 2019 91345.00
Ferrari 430 Red 2016 150234.00
Lamborghini Aventador Orange 2022 390000.00
McLaren MP4-12C Yellow 2017 172349.00
Mercedes CLS63/E63 Brown 2015 56183.00
Nissan GT-R Blue 2020 73435.00
Maserati Spyder Yellow 2015 63434.90
Tesla Model-X Black 2019 65834.73
Porche Boxter Yellow 2018 64654.66