Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. using namespace std;
  4.  
  5. class foo {
  6.     public:
  7.         foo(int fun);
  8.         ~foo();
  9.         int GetCoffee();
  10.  
  11.     private:
  12.         int coffee;
  13. };
  14.  
  15. foo::foo(int fun){
  16.     coffee = fun;
  17.     cout << "Initialized.\n";
  18. }
  19.  
  20. foo::~foo(){}
  21.  
  22. int foo::GetCoffee(){
  23.     return coffee;
  24. }
  25.  
  26. typedef class foo(foo2);
  27.  
  28. int main() {
  29.     foo2 pizza = 500;
  30.     cout << pizza.GetCoffee();
  31.     getch();
  32.  
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement