When i run thi program:-
//This program is for making a whole class friend & other stuffs.
#include <iostream>
#include <string>
using namespace std;
class First
{
int a;
string s="This part is within the First class.";
public:
friend class Second;
friend void ThirdFunction();
};
class Second
{
int b;
void mul (First*);
};
class Third
{
string t="This part is within Second class";
void ThirdFunction()
{
First fs;
cout << t << "\n" << fs.s;
}
};
Second::mul(First* ft)
{
cout << "This is the result of multiplication:" << ft -> a*b;
}
int main()
{
First* fi;
Second se;
Third th;
se.mul(fi);
th.ThirdFunction
}
I get the error that iso c++ forbids intialisation of member s.