I saw an example of friend class on www.cplusplus.com, please find it below:

// friend class
#include <iostream>
using namespace std;

class CSquare;

class CRectangle {
    int width, height;
    int area ()
      {return (width * height);}
    void convert (CSquare a);

class CSquare {
    int side;
    void set_side (int a)
    friend class CRectangle;

void CRectangle::convert (CSquare a) {
  width = a.side;
  height = a.side;
int main () {
  CSquare sqr;
  CRectangle rect;
  cout << rect.area();
  return 0;

After line using namespace std;
we have class CSquare;

I did not understand the purpose of declaring Class here, please guide me on why and what is the purpose of this line in the code?

nevermind I found it below on the link.. thanks all..