Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- class foo {
- public:
- foo(int fun);
- ~foo();
- int GetCoffee();
- private:
- int coffee;
- };
- foo::foo(int fun){
- coffee = fun;
- cout << "Initialized.\n";
- }
- foo::~foo(){}
- int foo::GetCoffee(){
- return coffee;
- }
- typedef class foo(foo2);
- int main() {
- foo2 pizza = 500;
- cout << pizza.GetCoffee();
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement