Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class test{
- protected:
- int field;
- test* next;
- public:
- test(int field);
- test(){;
- };
- ~test(){
- };
- static test* begin;
- static test* end;
- static void DelList();
- static void print();
- void add();
- virtual void show();
- };
- void test::add(){
- if (begin == NULL)
- { begin = this; end = this; this->next = NULL;}
- else { end->next = this; this->next = NULL; end = this;}
- };
- void test::print(){
- test* cur; //current
- cur = begin;
- while(cur != 0){
- std::cout << "check" << std::endl;
- cur->show();
- cur = cur->next;
- }
- }
- //================
- class example : public test{
- protected:
- int year;
- public:
- example() : test(){year = 0;};
- ~example(){
- };
- void show();
- };
- static int boo;
- int main(){
- test A;
- A.add();
- test::print();
- return 666;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement