In the following code segment
vector<SceneObject *> sceneObjs;
vector<SceneObject *>::iterator iter;
iter = sceneObjs.begin();
while (iter != sceneObjs.end()){
cout << **iter <<endl;
iter++;
}
why **iter has two *s ?
The first * dereferences the iterator, giving a SceneObject *
pointer. The second * dereferences this SceneObject *
pointer to the SceneObject
itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With