Click here to Skip to main content
15,790,976 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Quick ideas for activation Pin
TheGreatAndPowerfulOz5-Jan-06 21:33
TheGreatAndPowerfulOz5-Jan-06 21:33 
GeneralRe: Quick ideas for activation Pin
Alex Korchemniy6-Jan-06 8:32
Alex Korchemniy6-Jan-06 8:32 
Questionresolve crossed-bounds text Pin
s o v a n n5-Jan-06 15:51
s o v a n n5-Jan-06 15:51 
QuestionRetrofitting an MFC app to ActiveX Pin
Graham Reeds5-Jan-06 13:57
Graham Reeds5-Jan-06 13:57 
AnswerRe: Retrofitting an MFC app to ActiveX Pin
John R. Shaw5-Jan-06 14:20
John R. Shaw5-Jan-06 14:20 
GeneralRe: Retrofitting an MFC app to ActiveX Pin
Graham Reeds5-Jan-06 14:27
Graham Reeds5-Jan-06 14:27 
GeneralRe: Retrofitting an MFC app to ActiveX Pin
John R. Shaw6-Jan-06 18:17
John R. Shaw6-Jan-06 18:17 
Questionstl list<>::iterator for derived classes ?!? Pin
tbrake5-Jan-06 12:49
tbrake5-Jan-06 12:49 
Hi

i have a little problem using the list<>::iterator.

Assume you have a class CARS{ virtual void info();...}
and some public derived classes as GM{void info();...},BMW{void info();...}

<br />
...<br />
list<CARS> carpark;<br />
GM car1();<br />
GM car2();<br />
BMW car3();<br />
BMW car4();<br />
<br />
carpark..push_back(car1);<br />
carpark..push_back(car2);<br />
carpark..push_back(car3);<br />
carpark..push_back(car4);<br />
<br />
list<CARS>::iterator it;<br />
for(it=carpark.begin();it != carpark.end(); it++)<br />
{<br />
cout << it->info() << endl;<br />
}<br />
...<br />


so far so fine.

Now how to call the info() from GM or BMW using the iterator ??
(not the one from CARS)


THX

Tim

-- modified at 17:50 Thursday 5th January, 2006
AnswerRe: stl list&amp;amp;amp;lt;&amp;amp;amp;gt;::iterator for derived classes ?!? Pin
Christian Graus5-Jan-06 12:58
protectorChristian Graus5-Jan-06 12:58 
GeneralRe: stl list::iterator for derived classes ?!? Pin
tbrake5-Jan-06 13:08
tbrake5-Jan-06 13:08 
GeneralRe: stl list::iterator for derived classes ?!? Pin
Christian Graus5-Jan-06 13:11
protectorChristian Graus5-Jan-06 13:11 
QuestionRe: stl list::iterator for derived classes ?!? Pin
tbrake5-Jan-06 13:29
tbrake5-Jan-06 13:29 
AnswerRe: stl list::iterator for derived classes ?!? Pin
Christian Graus5-Jan-06 13:32
protectorChristian Graus5-Jan-06 13:32 
GeneralRe: stl list::iterator for derived classes ?!? Pin
tbrake5-Jan-06 13:43
tbrake5-Jan-06 13:43 
GeneralRe: stl list::iterator for derived classes ?!? Pin
Christian Graus5-Jan-06 13:46
protectorChristian Graus5-Jan-06 13:46 
AnswerRe: stl list&amp;amp;lt;&amp;amp;gt;::iterator for derived classes ?!? Pin
Christian Graus5-Jan-06 13:55
protectorChristian Graus5-Jan-06 13:55 
QuestionGet Status of Comm Port Pin
tj_cts5-Jan-06 10:00
tj_cts5-Jan-06 10:00 
AnswerRe: Get Status of Comm Port Pin
KellyR5-Jan-06 10:12
KellyR5-Jan-06 10:12 
GeneralRe: Get Status of Comm Port Pin
tj_cts5-Jan-06 11:12
tj_cts5-Jan-06 11:12 
GeneralRe: Get Status of Comm Port Pin
Blake Miller5-Jan-06 13:31
Blake Miller5-Jan-06 13:31 
QuestionHow to submit information from an application? Pin
kevincwong5-Jan-06 9:47
kevincwong5-Jan-06 9:47 
AnswerRe: How to submit information from an application? Pin
Office Lineman5-Jan-06 10:19
Office Lineman5-Jan-06 10:19 
GeneralRe: How to submit information from an application? Pin
kevincwong6-Jan-06 12:50
kevincwong6-Jan-06 12:50 
GeneralRe: How to submit information from an application? Pin
Office Lineman6-Jan-06 13:19
Office Lineman6-Jan-06 13:19 
GeneralRe: How to submit information from an application? Pin
kevincwong6-Jan-06 20:15
kevincwong6-Jan-06 20:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.