Home > Back-end >  Teach new o
Teach new o

Time:10-09

#include
#include
using namespace std;
The class Seller
{
Public:
Seller (char name [10], char nu [30])
{
Strcpy (num, nu);
}
The Seller ()
{

Strcpy (name, "Sunny");
Strcpy (num, "002");
}
Void the show ()
{
Cout}
Private:
Char num [30].
Char name [10].
};
The class Book
{
Public:
The Book ()
{
Strcpy (name, "Brother");
Price=54.2 f;
}
Book (float p, char n [30], char b [10], [30] char m) : the seller (b, m)
{
Price=p;
Strcpy (name, n);
}
Void the show ();
~ the Book () {}
Private:
Seller Seller;
Float price;
Char name [30].
};
Void Book: : show ()
{
Cout<& lt;" The title is: "& lt; Seller. The show ();
Cout}
Int main ()
{
Book a t1 (26.2, "To Live", "MIKE", "001");
The Book t2;
Book t3 (32.5, "Chronicleofa" break ", "Stan", "003");
T1. The show ();
T2. The show ();
T3. The show ();
return 0;
}


Could you tell me why very hot very hot very hot?

CodePudding user response:

 
Seller (char name [10], char nu [30])
{
Strcpy (this - & gt; The name, name);
Strcpy (num, nu);
}
  • Related