"mark" <anthonymor...@...> wrote:
>
> please help me, with this. im getting 2 errors
>
> 1. error C2653: 'Anthony' : is not a class or namespace name
> 2. error C2248: 'Mark::id' : cannot access private member
> declared in class 'Mark'
>
> i using visual c++ 2008
>
> here is my code.
> ----------------------------------------------------------
> #include <iostream>
>
> using namespace std;
>
> class Mark
> {
> public:
> Mark(int x = 900): id(x){}
> friend void Anthony::function(const Mark& mark);
At this point, you have made no mention that there is a class
called Anthony. So, the compiler complains. You need a forward
declaration of class Anthony before you declare Mark.
class Anthony;
> private:
> int id;
> };
The second error is probably just a result of the first.
--
Peter