View Single Post
  #2 (permalink)  
Old 11-09-2007, 03:03 AM
Bench Bench is offline
Full Programmer
Join Date: Jul 2007
Location: UK
Posts: 113
iTrader: (0)
Bench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished road
If you wish to initialise your array elements to zero, you can declare the array using the following syntax (This means you don't need to loop through and do it manually)
Code:
    int bookings[100] = { 0 };
Also, what output are you expecting to get? What output are you actually getting?


Could you give a few lines of your input file as an example of the data you're trying to read? I can't see any obvious problems with your code, except that when you use your flightpas variable in your array subscript, you've not checked that its a valid index for your bookings array (ie, a number in the range 0-99). This may or may not be a problem depending on your input file.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
The Following User Says Thank You to Bench For This Useful Post:
HelloWorld (11-09-2007)