Custom data iterator
-
Does anyone know how to declare an iterator to, say, a struct variable? Here's an eg of a struct I declared outside a function: struct vStruct { CString szString; int nInt; double dDouble; } v; Then, inside the function I have: std::vector vStruct; And the problem is when I do this: std::vector::iterator iStruct; Thx, Ralf. ralf.riedel@usm.edu
-
Does anyone know how to declare an iterator to, say, a struct variable? Here's an eg of a struct I declared outside a function: struct vStruct { CString szString; int nInt; double dDouble; } v; Then, inside the function I have: std::vector vStruct; And the problem is when I do this: std::vector::iterator iStruct; Thx, Ralf. ralf.riedel@usm.edu
RalfPeter wrote: And the problem is when I do this What's the problem? What does the compiler say?
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
-
Does anyone know how to declare an iterator to, say, a struct variable? Here's an eg of a struct I declared outside a function: struct vStruct { CString szString; int nInt; double dDouble; } v; Then, inside the function I have: std::vector vStruct; And the problem is when I do this: std::vector::iterator iStruct; Thx, Ralf. ralf.riedel@usm.edu
I think some of your < and > symbols have been stripped out by CP. But what you need to do to declare the iterator is:
std::vector<vStruct>::iterator iStruct;
Mike -
RalfPeter wrote: And the problem is when I do this What's the problem? What does the compiler say?
Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"