By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,750 Members | 1,199 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,750 IT Pros & Developers. It's quick & easy.

using of "static const" in class with no imediately init

P: n/a
hello,

i have the code:
class window
{
static const HWND hWnd;
static const HINSTANCE hInst;
// ... next code here
window (HINSTANCE );
}
window::window ( HINSTANCE hInstance )
{
// and i try to definie the hInst
hInst (hInstance);
// next code here
}
But that not accepted for my compiler intel 8.0
How i can initialize a static const data in my code, but not immédiately and
in a fonction.
thank you for your response.
HEINQUOI
Jul 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"heinquoi" <no**************@libertysurf.fr> schrieb im Newsbeitrag
news:40***********************@news.free.fr...
hello,

i have the code:
class window
{
static const HWND hWnd;
static const HINSTANCE hInst;
// ... next code here
window (HINSTANCE );
}
window::window ( HINSTANCE hInstance )
{
// and i try to definie the hInst
hInst (hInstance);
// next code here
}
But that not accepted for my compiler intel 8.0
How i can initialize a static const data in my code, but not immediately and in a fonction.

use const HWND hwnd = ... or leave the const off. You cannot assign
any "const" variable a value other than on creation of it.
Make your variable private, so nothing can alter it from outside.

--
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}

________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com
Jul 22 '05 #2

P: n/a

"Gernot Frisch" <Me@Privacy.net> a écrit dans le message de
news:2g***********@uni-berlin.de...

use const HWND hwnd = ... or leave the const off. You cannot assign
any "const" variable a value other than on creation of it.
Make your variable private, so nothing can alter it from outside.


thank for your answer
Heinquoi
Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.