Home > Back-end >  Outside the class to write the constructor error
Outside the class to write the constructor error

Time:09-16

#include
#include
using namespace std;

//class do friends
The class Building;
The class GoodGay
{
Public:
GoodGay ();
Void visit ();//visit functions to access Building attributes in the
Building * Building;
};
The class Buliding
{
Friend class GoodGay;
Public:
Buliding ();


Public:
String m_SittingRoom;//living room
Private:
String m_BedRoom;//bedroom
};
//class to write a member function
Building: : Buliding ()
{
M_SittingRoom="living room".
M_BedRoom="bedroom".
}
GoodGay: : GoodGay ()
{
//create buildings object
Building=new building;
}
Void GoodGay: : visit ()
{
Cout & lt; <"Good gay friends are visiting:" & lt; Cout & lt; <"Good gay friends are visiting:" & lt; }
Void test01 ()
{
GoodGay gg ();
Gg. Visit ();
}
Int main ()
{
return 0;
}

CodePudding user response:

Pay attention to spelling mistake
  • Related