[ create a new paste ] login | about

Link: http://codepad.org/D4WSyUFQ    [ raw code | output | fork ]

C++, pasted on Jan 20:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>

class Base{
  private:
   int a;
  public:
   Base():a(5){ 
  }

  virtual void print(){
   std::cout<<"In base "<<this->a<<std::endl;
  }
}

int main(){
 Base* b = new Base;
 b->print();
 return 0;
}


Output:
1
2
Line 15: error: new types may not be defined in a return type
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: