P
Pavan
Hi,
My application requires usage of overloaded operator [] using
pointer
My application is like this
vector<int> * ptr;
Now I should access elements of the vector using vector pointer but
the below code is giving compilation error:
for(unsigned int i=0; i < ptr->size(); i++)
{
cout << ptr-> << endl; // I know that while calling as a member
we dont use dot operator before [] like how I am using -> here, so is
it not possible to access elements using [] with pointer at all? Is
there any alternative
}
My application requires usage of overloaded operator [] using
pointer
My application is like this
vector<int> * ptr;
Now I should access elements of the vector using vector pointer but
the below code is giving compilation error:
for(unsigned int i=0; i < ptr->size(); i++)
{
cout << ptr-> << endl; // I know that while calling as a member
we dont use dot operator before [] like how I am using -> here, so is
it not possible to access elements using [] with pointer at all? Is
there any alternative
}