-
Compile Problem
Hey Guys
When i try and compile my program which i have basically just set a class for file acess up in i get this compile error any ideas.
dwShareMode is defined as a DWORD under private in my class
'dwShareMode' : pure specifier can only be specified for functions
Thanks
Peter
-
=0 in the end of a function declaration means it's pure virtual, however i thin you are just trying to initialize a variable in the wrong place. There is a specific function called constructor with the same name as the class where you initialize all variable needed to initialize
-
As kedaman sorta said, you cannot initialize variables in a class as you would in a function.
Code:
class myClass
{
public:
myClass();
protected:
DWORD someVar = 0; // This is incorrect;
};
class myClass
{
public:
myClass();
protected:
DWORD someVar; //Correct
};
myClass::myClass()
{
someVar = 0;
}
Z.