Static constant class members

Eljay Love-Jensen eljay@adobe.com
Sat Feb 28 21:23:00 GMT 2004


Hi Vova,

You cannot initialize static data members in-class.  (You can in Java, not 
in C++.)

You need to do this:

--- TxtVideo.h ---
class TxtVideo {
   protected:
	static unsigned int* const VBASE;

--- TxtVideo.cpp ---
unsigned int* const TxtVideo::VBASE = (unsigned int*) 0x0c00b8000L;

HTH,
--Eljahy



More information about the Gcc-help mailing list