/*C++ program to demonstrate example of friend function with class.*/
#include <iostream>
 
using namespace std;
 
class STUDENT
{
private:
    int Score;
public:
    void getScore(int x);
    //declaration of friend function
    friend void printScore(STUDENT ScoreParam);
};
 
//class member function definitions
void STUDENT::getScore(int x)
{
    Score = x;
}
 
//friend function definition, no need of class name with SRO (::)
void printScore(STUDENT ScoreParam)
{
    cout << "Value of a (private data member of class Number): " << ScoreParam.Score;
}
 
int main()
{
    STUDENT nObj; //Object declaration
    nObj.getScore(1000);
    printScore(nObj);
    return 0;
}

