1Answers
Write the results of the operation, wait online, so anxious!IntersectionIntersection
Asked by: Ralph Mason 10 views IT
#include
Class MyClass
{
CHAR CH;
PUBLIC:
MyClass ();
MyClass (Char Character);
Void Print ();
~ myclass ();
};
MyClass :: myclass ()
{
Cout < <"this is a constructor!" <<
ch> ch> ch> ch>
}
MyClass :: myclass (char charter)
This is a constructor! "<<
ch> ch = charActer;
}
void myclass ::)
{
COUT < <>
{
COUT < < <>>! "p> {
MyClass First, Second ('B');
***. Print ();
***. Print ();
}
addition: The first *** below is First, the second *** is Second
+3Votes
The program is wrong, there are many full -angle characters, and the edit function is also written wrong. Wait, the program after correction is as follows:
#InClude
USING NAMESPACE Std;
Class MyClass
{
CHAR CH;
Public:
MyClass ();
MyClass (Char Character);
void print ();
~ myclass ();
};
MyClass :: myclass ()
{
COUT << "This is a constructor!" << Endl;
ch = ‘A’;> MyClass :: MyClass (Char Character)
{
COUT << "This is a constructor!" << Endl;
ch = Character;
}
void myclass :: Print)
{
Cout << "The value of ch is" << ch
}
myclass :: ~ myclass ()
{
COUT << "" "" "" "" "" "This is a desructor! "<< Endl;
}
int main ()
{
MyClass First, Second (‘B’);
first.print ();
second.print ();
Return 0;
}
The running result of the program: