friend operator

Hello,

I have a problem by compiling a class with the following friend function in Header file:

class X{

 private:
          ......

 protected:
          .......

 public:

     friend ostream& operator<<\(ostream& target, const PARA_DSC& para\);

};

the compiler output is:

"X.hxx", line 346: Warning (Anachronism): Class friends require an explicit "class".
"X.hxx", line 346: Error: "," expected instead of "&".
1 Error(s) and 1 Warning(s) detected.
*** Error code 1

Has anybody an idea, where the problem coud be?

Greetings

nik

I think you need to put the "friend" after the return value of the operator. I.e.:

ostream& friend operator<<(ostream& target, const PARA_DSC& para);

If "friend" is the first token, then it expects the declaration of a friend class.