|
-
Jul 31st, 2001, 12:28 PM
#1
Thread Starter
Lively Member
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
"Let's all join forces, rule with an iron hand...and prove to all the world, metal rules the land..."
-- Judas Priest
My email is [email protected]
-
Jul 31st, 2001, 01:40 PM
#2
transcendental analytic
=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
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 31st, 2001, 03:41 PM
#3
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|