|
#1
|
|||
|
|||
Re: C Programming Halp! :)
you're trying to print out every car in the .data file that has the same year as the year you're searching for.
somehow, you're going to need to get all the cars into an arraylist (not in this function), and then call this function when you want to print out all the cars with a specific year. plist is going to be the array with all the cars, targetYear is the year that you're going to be searching for, loc is going to be the location (index in plist) of the last car found with targetYear. (you can pass for example a loc=-1 value and if no cars are found, loc will remain -1, otherwise the last car with the targetYear found's location will be the new loc after you run the program). |
#2
|
|||
|
|||
Re: C Programming Halp! :)
btw, plist holds an array of "car". if your professor hasnt given you the skeleton for that class or the function to get the array list from the .data file, you have a long way to go
|
#3
|
|||
|
|||
Re: C Programming Halp! :)
[ QUOTE ]
btw, plist holds an array of "car". if your professor hasnt given you the skeleton for that class or the function to get the array list from the .data file, you have a long way to go [/ QUOTE ] I know I'm nit-picking hear, but it's C, not C++ or Java, so "car" would be a structure, not a class. |
|
|