Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Other Topics > Computer Technical Help
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-15-2007, 09:18 PM
frinxor frinxor is offline
Senior Member
 
Join Date: Dec 2006
Location: santa barbara
Posts: 144
Default 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).
Reply With Quote
  #2  
Old 09-15-2007, 09:20 PM
frinxor frinxor is offline
Senior Member
 
Join Date: Dec 2006
Location: santa barbara
Posts: 144
Default 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
Reply With Quote
  #3  
Old 09-15-2007, 10:58 PM
CORed CORed is offline
Senior Member
 
Join Date: Sep 2002
Posts: 4,798
Default 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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:02 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.