S
steflhermitte
Dear cpp-ians,
I am working with a structure
struct segment
{
....
vector <meta_segment>::iterator it_Z;
....
};
and a variable of that type:
segment *** output;
I also have a pointer to an element of a vector
meta_segment * Z;
Now I want to assign the address of Z to the iterator Z:
output[y][y]->it_Z = Z;
but it does not work.
I assume the problem is my missunderstanding of the concept of pointers
and iterators. My rationing goes as follows:
- Iterators are generalized pointers that allow me to navigate in
vectors.
- Iterators are consequently the adresses of the elements of my vector.
- output[y][y]->it_Z has to be the adress of a meta_segment
- Z is a pointer to (= the address of) a meta_segment
Where do I go wrong? Or why the assignment to output[y][y]->it_Z fails?
Thanks in advance! Kind regards,
Stef
I am working with a structure
struct segment
{
....
vector <meta_segment>::iterator it_Z;
....
};
and a variable of that type:
segment *** output;
I also have a pointer to an element of a vector
meta_segment * Z;
Now I want to assign the address of Z to the iterator Z:
output[y][y]->it_Z = Z;
but it does not work.
I assume the problem is my missunderstanding of the concept of pointers
and iterators. My rationing goes as follows:
- Iterators are generalized pointers that allow me to navigate in
vectors.
- Iterators are consequently the adresses of the elements of my vector.
- output[y][y]->it_Z has to be the adress of a meta_segment
- Z is a pointer to (= the address of) a meta_segment
Where do I go wrong? Or why the assignment to output[y][y]->it_Z fails?
Thanks in advance! Kind regards,
Stef