hey i have most of the program done, the project is a train yard simulation (inheritances practice), but i have ran into a block where im trying to read in from a file, with multiple sets of data, how should i put them into different arrays? i.e if i had say 10 arrays, and i wont know how many objects but i can just put them onto an array as the data comes in. i know its dumb but my professor is kinda weird and never really think thought her projects.
thanks in advance
(and saying that she has a set of data (instructions on a text file) then use our program to assumable it with a linked list(already done that part) then take in another set of data and do that same thing(but the problem is i wont know how many sets of data im supposed to take in because she said it can change)
so far i have the general structure of
while(file is good)
get data and put them onto a linked list to represent the trains
then using if statements to interpret the data, and when the first train ends
but now im stuck on how to generate the second and third train or 4th
i dont think so because that will give me an error, while compiling but right now iv worked passed all of that problems and only is left with the actualy programing:
how do i make a array of pointers each pointing to a linkedlist?
so far i have
but now i dont know how to use it to actualy store the linkedlist into the array.
i tried these and it didnt work because they said type did not match:
Linklist<RailroadCar> temptrain;// the linkedlist i want to store into the array
and when i tried traintracks= temptran;// it just tells me a type Linklist<RailroadCar> cannot be converted into Linklist<RailroadCar>*