Name: OP 2010-11-08 4:10
in c++.
i have a list of pointers to a class called Intersection:
list <Intersection *> all;
Within my Intersection class, there is a public member variable that is a list of road segments:
list <class Road_Segment *> adj;
i dont want to bog yall down with the nitty gritty details of my assignment, but what I need to do is:
iterate through 'all' and reassign new 'adj' values to each Intersection that 'all' points to.
IN A NUTSHELL: i dont know what syntax to use when using a list iterator to iterate through a list of pointers, and change the values of the member variables of the class that the pointers point to...
Thats about as simply as i think i can put it.
by using *lit im accessing the pointers to the intersection class... and I want to think that dereferencing those pointers would give me access to the intersection classes' member variables. which i could then modify using arrow/dot notation to specify which particuliar one.
i have a list of pointers to a class called Intersection:
list <Intersection *> all;
Within my Intersection class, there is a public member variable that is a list of road segments:
list <class Road_Segment *> adj;
i dont want to bog yall down with the nitty gritty details of my assignment, but what I need to do is:
iterate through 'all' and reassign new 'adj' values to each Intersection that 'all' points to.
IN A NUTSHELL: i dont know what syntax to use when using a list iterator to iterate through a list of pointers, and change the values of the member variables of the class that the pointers point to...
Thats about as simply as i think i can put it.
by using *lit im accessing the pointers to the intersection class... and I want to think that dereferencing those pointers would give me access to the intersection classes' member variables. which i could then modify using arrow/dot notation to specify which particuliar one.