Need help with basic class stuff

I'm learning classes and think I sort of know what I'm doing after reading the tutorials on this site and running over some examples. I'm now trying to understand some very object-oriented C++ code, and came across the following:

net->outputs.begin()

where net is a pointer to a class, and outputs is a vector. Now, as I understand it the -> convention basically says that we should access the element name pointed to by the right hand side in the class that the element on the left hand side points to, right? But outputs.begin() is a pointer, not the name of an element of a class member, so what's going on here??

The complete line on which I found this is here:

out[count]=(*(net->outputs.begin()))->activation;
Last edited on
Oh right, looking at it now I think I was just reading this wrong. net->outputs is itself a vector, so net->outputs.begin() is really (net->outputs).begin()...

Sometimes it helps just to write it down. Thanks for the writing space :)
Topic archived. No new replies allowed.