Printing several arrays by calling 1 array!

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

30 Replies - 1170 Views - Last Post: 02 October 2012 - 09:03 PM Rate Topic: -----

#31 busta5000  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: -7
  • View blog
  • Posts: 147
  • Joined: 08-March 08

Re: Printing several arrays by calling 1 array!

Posted 02 October 2012 - 09:03 PM

View PostSkydiver, on 02 October 2012 - 08:19 PM, said:

Okay, now try entering 3 flights, and delete the first flight. See what happens when you list your flights after the delete.


Damn I never saw that coming! I have only tested it using 2 it appears it deletes the older flight created! I do not understand if you look at the snippets below it should work I actually asked the instructor he said if you type those snippets it should work!
Global Variable;
FlightType allFlights[20], aFlight;
FlightNo=0;



Creating Flight function
allFlights[FlightNo]=aFlight;
FlightNo++;



I hope you can explain why what is the logic of this code if its not to assign the array every time a flight is created!
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3