Hi,
I have a protected vector declared in a header file abc.h
To access the protected vecInstance i declared useProtected() in the same classs as above
I used it in another cpp file "a.cpp"
And i finally declared "useProtected() " in one cpp file
[code]
void A::useProtected ()
{
int i=vecInstance.s ize();
}
[/ode]
but ended up getting error
please help....
}
I have a protected vector declared in a header file abc.h
Code:
class A
{
protected: typedef vector<int> y;
y vecInstance;
void useProtected(void);
}
I used it in another cpp file "a.cpp"
Code:
A instanceOfA; instanceOfA.useProtected();
[code]
void A::useProtected ()
{
int i=vecInstance.s ize();
}
[/ode]
but ended up getting error
Code:
Protected cannot use protected member
please help....
}
Comment