Stl vector problem

sib

Joined
Nov 29, 2010
Messages
1
Reaction score
0
Code:
int main()
{
	Airport port(0,5);    	
    	port.add_flight("Hong Kon", 4, 2, 80, 20);
    	port.add_flight("aaaa aaaa", 3, 2, 80, 20);
}

Code:
Created Airport at time= 0 and terminal#= 5
Created Flight with Destination= Hong Kon Departs at= 4 and has Duration= 2
Created Flight with Destination= aaaa aaaa Departs at= 3 and has Duration= 2
[COLOR="Red"]Deleted Flight with Destination= Hong Kon and depart time= 4[/COLOR]
Destroyed airport
Deleted Flight with Destination= Hong Kon and depart time= 4
Deleted Flight with Destination= aaaa aaaa and depart time= 3
scenario2

Code:
int main()
{
	Airport port(0,5);
    	port.add_application("egg nog", "Hong Kon",  666, 2, 10, 0);
    	port.add_application("fat pig", "Hong Kon",  555, 2, 10, 0);
}

Code:
Created Airport at time= 0 and terminal#= 5
Created Application, with name= egg nog Id= 666 Destination= Hong Kon
Created Application, with name= fat pig Id= 555 Destination= Hong Kon
Destroyed airport
Destroyed Appication with name = egg nog Id =666
Destroyed Appication with name = fat pig Id =555

add application
Code:
	Application* Applic;
	Applic= new Application(...);
	waiting_list.push_back(*Applic);

add flight

Code:
Κώδικας:
	Flight* flying;
	flying= new Flight(...);
	terminal.push_back(*flying);

- waiting list is stl list, terminal is stl vector
-if i convert the vector to list, the deconstructors work like normal,but i need vector
-my constructors are simple, only create 2 news for char*, my destructors do nothing other than cout...

why doesnt the application work and the terminal not?(which i understand is vector vs list problem...)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top