I'm trying to use a tree control in c++ using an example from a book.
I can understand that the 'InsertItem' method called with a litteral string creates a node with that litteral string as a tag. (eg. aTree.InsertItem("Fred" creates a fred node). however, I don't (fully) understand the following code the book uses to create a list of A - Z tags:
for (int nChar='A';nChar<='Z'; nChar++)
hLetter[nChar - 'A'] =m_treeFiles.InsertItem((TCHAR*)&nChar);
This would appear to me (in my blissful ignorance) to be creating a node whose label is a pointer to the variable nChar.
how come (at the end of the procedure) these aren't all the same - ie. 'Z'??
(I'm really new to c++ abd just stuggeling to get to grips with microsoft visual c++ 6.0 so please excuse dumb questions!!)
I can understand that the 'InsertItem' method called with a litteral string creates a node with that litteral string as a tag. (eg. aTree.InsertItem("Fred" creates a fred node). however, I don't (fully) understand the following code the book uses to create a list of A - Z tags:
for (int nChar='A';nChar<='Z'; nChar++)
hLetter[nChar - 'A'] =m_treeFiles.InsertItem((TCHAR*)&nChar);
This would appear to me (in my blissful ignorance) to be creating a node whose label is a pointer to the variable nChar.
how come (at the end of the procedure) these aren't all the same - ie. 'Z'??
(I'm really new to c++ abd just stuggeling to get to grips with microsoft visual c++ 6.0 so please excuse dumb questions!!)