Skip to content

Instantly share code, notes, and snippets.

@Soulstorm50
Created June 12, 2016 18:25
Show Gist options
  • Save Soulstorm50/ecab0939fc29c1928f3ed67b4b894196 to your computer and use it in GitHub Desktop.
Save Soulstorm50/ecab0939fc29c1928f3ed67b4b894196 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
class Book //класс книга
{
public: // модификатор доступа
char* name; // модель планшета
char* colour; // цвет
int year; // год издания
int pages; //
// методы:
void Read() //метод Read.
{
cout <<"You are reading "<<name << " now.\n";
}
void Leafe() //метод Leafe
{
cout << "You are leafing all " << pages << " pages now.\n";
}
};
void main()
{
Book b;
b.name = "C++ S.Prata";
b.colour = "White";
b.year = 2016;
b.pages = 1244;
b.Read();
b.Leafe();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment