#include <iostream>
using namespace std;
class A
{
private:
int a;
};
A::A()
{
a = 10;
}
int main()
{
A obj1;
cin.ignore();
cin.get();
}
It is giving me the error
Error 1 error C2600: 'A::A' : cannot define a compiler-generated special member function (must be declared in the class first) c:\documents and settings\levi\desktop\stfu\stfu\main.cpp 14
Am I just completely forgetting to do something? The error message makes it sound like A is a function, when Im just trying to declare a variable using a default constructor. Help please!