I am Java developer and I am new in C++. Try below code and it display initialization of non-const static member error.
class omtFirst {
int a = 8,b = 2;
public:
void printThis(string);
int addNumber(){
return (a+b);
};
};
After search on net i found that we can not initialize variable in the class description. But in Java it is possible. Why in C++ we can not initialize variable in the class description.