[ create a new paste ] login | about

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

C++, pasted on Jul 24:
#include <iostream>

using namespace std;

class Test
{
 public:
 int RetA() const
{
cout<<"RetA const"<<endl;
return a;
}

 int RetA()
{
cout<<"RetA"<<endl;
return a;
}
 
private:
int a;
};

int main()
{
  //Test t1;
//t1.RetA();

const Test t2;
t2.RetA();

return 0;
}


Output:
1
2
3
In function 'int main()':
Line 29: error: uninitialized const 't2'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: