NDISKS 3
DISKTIME 10
NBOXES 32
START 7
CPU 100
TTY 5000
CPU 50
TTY 100
CPU 90
SEND 12
CPU 50
TTY 100
CPU 50
DISK 0
CPU 20
START 124
CPU 80
DISK 1
CPU 50
RECEIVE 12
CPU 100
TTY 150
CPU 200
DISK 1
CPU 100
DISK 1
CPU 100
DISK 1
CPU 100
DISK 1
CPU 100
TTY 500
CPU 100
SEND 7
CPU 150
START 205
CPU 100
TTY 3000
CPU 50
TTY 100
CPU 50
TTY 2000
CPU 50
DISK 1
CPU 20
DISK 1
CPU 60
DISK 1
CPU 50
DISK 1
CPU 50
DISK 1
CPU 50
TTY 100
CPU 50
Long story short, given the requirements for part of my assignment to separate each type of processes (the left column) I created arrays to store the file input and then every time I read a certain 'key' word I would create a new queue. Some one from one of my earlier posts suggested to harbor my queues in vectors and that would make work much easier. I read about vectors so and I tried implementing in my program and have ran into weird trouble.
Everytime my compilers gets to the part where I push stuff into the vector<queue> it gives me a runtime error.
Please note: the program compiles without erors and I have verified that the only reason for runtime error is when I try pushing stuff on to vector<queue>.The statement that causes the error is inside the else[] and is in bold.
Please if some one can look through my code and point me out what am I doing wrong and how can I resolve it.
To clarify, on line 113 you access the first element of a vector that has no elements. That's not good.
The whole design looks suspect. I suspect CreateQueues should be doing something other than creating a local vector of queues that will go out of scope when the function returns.