Click here to Skip to main content
15,927,890 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Traversing array Pin
Jon Hulatt15-May-02 23:21
Jon Hulatt15-May-02 23:21 
GeneralRe: Traversing array Pin
alex.barylski16-May-02 1:08
alex.barylski16-May-02 1:08 
GeneralRe: Traversing array Pin
Jon Hulatt16-May-02 2:52
Jon Hulatt16-May-02 2:52 
GeneralRe: Traversing array Pin
Christian Graus15-May-02 23:05
protectorChristian Graus15-May-02 23:05 
GeneralRe: Traversing array Pin
alex.barylski16-May-02 1:04
alex.barylski16-May-02 1:04 
GeneralRe: Traversing array Pin
Christian Graus16-May-02 1:05
protectorChristian Graus16-May-02 1:05 
GeneralRe: Traversing array Pin
alex.barylski16-May-02 13:14
alex.barylski16-May-02 13:14 
GeneralRe: Traversing array Pin
Christian Graus16-May-02 13:29
protectorChristian Graus16-May-02 13:29 
Hockey wrote:
how do I iterate the array above, considering children can have children and so on...

Recursion

A function needs to take an ITEM, then it needs to iterate through the array of items in it something like this

RecurseThroughMenu(ITEM item)
{
foreach (ITEM i in item.Child)
{
// add item i to the menu under 'item'
if (i.Child.length > 0)
RecurseThroughMenu(i)
}
}

This is not meant to be any particular language, just give you the idea how to do it Smile | :)


Christian

The tragedy of cyberspace - that so much can travel so far, and yet mean so little.

And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
GeneralRe: Traversing array Pin
alex.barylski16-May-02 13:52
alex.barylski16-May-02 13:52 
QuestionHow to smooth drawing on the screen? Pin
davilism15-May-02 22:00
davilism15-May-02 22:00 
AnswerRe: How to smooth drawing on the screen? Pin
Alexandru Savescu15-May-02 22:15
Alexandru Savescu15-May-02 22:15 
AnswerRe: How to smooth drawing on the screen? Pin
Tomasz Sowinski16-May-02 2:30
Tomasz Sowinski16-May-02 2:30 
QuestionIDataObject GetData OOOOLD Win 3.1 Metafiles ?????????????? Pin
Braulio Dez15-May-02 22:05
Braulio Dez15-May-02 22:05 
QuestionWhy my program runs well in normal LAN while die in Wireless LAN? Pin
Cloudway15-May-02 21:54
Cloudway15-May-02 21:54 
AnswerRe: Why my program runs well in normal LAN while die in Wireless LAN? Pin
Joaquín M López Muñoz15-May-02 22:07
Joaquín M López Muñoz15-May-02 22:07 
GeneralRe: Why my program runs well in normal LAN while die in Wireless LAN? Pin
Rickard Andersson2015-May-02 22:56
Rickard Andersson2015-May-02 22:56 
GeneralRe: Why my program runs well in normal LAN while die in Wireless LAN? Pin
15-May-02 23:02
suss15-May-02 23:02 
GeneralRe: Why my program runs well in normal LAN while die in Wireless LAN? Pin
markkuk16-May-02 1:05
markkuk16-May-02 1:05 
AnswerRe: Why my program runs well in normal LAN while die in Wireless LAN? Pin
markkuk16-May-02 1:08
markkuk16-May-02 1:08 
GeneralWhich message Windows senв to control, when I press Alt key... Pin
Alex Cramer15-May-02 21:32
Alex Cramer15-May-02 21:32 
GeneralRe: Which message Windows senв to control, when I press Alt key... Pin
Christian Graus15-May-02 22:50
protectorChristian Graus15-May-02 22:50 
GeneralCStrin passing error! Pin
tongc15-May-02 19:06
tongc15-May-02 19:06 
GeneralRe: CStrin passing error! Pin
Christian Graus15-May-02 19:27
protectorChristian Graus15-May-02 19:27 
GeneralRe: CStrin passing error! Pin
Alexandru Savescu15-May-02 22:11
Alexandru Savescu15-May-02 22:11 
GeneralRe: CStrin passing error! Pin
Jonathan Craig16-May-02 10:32
Jonathan Craig16-May-02 10:32 

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.