1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| #include<iostream.h>
#include<iomanip.h>
#include<string.h>
class Book
{
public:
char title[256];
char author[64];
float price;
/*----(2)----*/
void show_title() ;
/*--(@)--*/
void show_book() ;
/*-----(3)----*/
private:
char publisher[256];
void show_publisher(char *name) ;
};
/*------(1)----*/
void Book::show_book ()
{
show_title();show_publisher(char *name);
}
/*------(2`)----*/
void Book::show_title()
{
cout<<title<<endl;
}
/*--------(3`)----*/
void Book::show_publisher(char *name)
{
strcpy(publisher,"nouvelle collection");
cout<<publisher<<endl;
}
/*-----------------*/
void main()
{
Book primer;
strcpy(primer.title, "C/C++ primery i zadachi");
primer.show_book();
} |
Partager