Labels

16/07/2009

Varible definition


(变量定义)
parameter definition should be in .h file. If this variable is used in this window/form (qqWidget.h), just declare in “private:”. But if used in anther window/form, should declare in “public:”.

// globalvar.h
#ifndef MYGLOBALS
#define MYGLOBALS

extern int variable1;
extern int variable2;

#endif
...

// globalvar.cpp implementation

int variable1= 0;
int variable = 0;

No comments:

Post a Comment