Im a fairly fresh programmer, and I often run into problems like most of us. Most of the time I get it solved in 10 minutes by some google power, but this time Im stuck for real (spent the last 4 hours looking around the web).
I first ran into the problem of not beeing able to retrieve the size of an array through a pointer (since sizeof(*k); doesn't work). I tried solving this by using a Vector instead, but ended up running into this horrible problem.
From what I understood from forums etc, the arrow operator (->) should be useable with a iterator of a vector to reach functions defined in the vector object.
So, my questions are: Why doesn't this work? And do someone have a better suggestion to get the size of an array/vector by using a pointer than this? (This is just an illustration, in my real program the pointer is sent to a function where I want to retrieve the length of the array without sending it from my main function).
void main()
{
vector<int> x;
x[0]=5;
vector<int>::iterator y = x.begin();
int z = y->size();
}