Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // magazine.h
- #ifndef MAGAZINE_H
- #define MAGAZINE_H
- #include <string>
- using namespace std;
- class CMagazine{
- public:
- CMagazine();
- CMagazine(string tt,long cd,int vol);
- void showMagazineDetail();
- private:
- int volume;
- string title;
- long code;
- };
- #endif
- // magazine.cpp
- #include <iostream>
- #include "magazine.h"
- using namespace std;
- CMagazine::CMagazine() {}
- CMagazine::CMagazine(string tt, long cd, int vol) {
- volume = vol;
- title = tt;
- code = cd;
- }
- void CMagazine::showMagazineDetail() {
- cout<<"[杂志]---"<<"(杂志名):"<<title<<","<<"(条形码):"<<code<<","<<"(卷号):"<<volume<<endl;
- }
Add Comment
Please, Sign In to add comment