Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!sun-barr!decwrl!shelby!neon!rokicki From: rokicki@Neon.Stanford.EDU (Tomas G. Rokicki) Newsgroups: comp.sys.amiga Subject: C++ static members Message-ID: <1989Dec29.075858.27337@Neon.Stanford.EDU> Date: 29 Dec 89 07:58:58 GMT Sender: USENET News System Organization: Computer Science Department, Stanford University Lines: 26 Static members can be made to work with Lattice C++ (there is a section in the manual on this; you use an option on the compiler to compile the header *once* keeping the static member, and another option the rest of the time.) Personally, I don't like this kludge, so I do the equivalent simple thing instead: Class.h: class Class { static int foo ; } ; I change this to: class Class { } ; extern int _Class_foo ; and in Class.cp I int _Class_foo ; It's portable. (Note that _Class_foo is in the namespace that is reserved for the compiler, really, so a different name should be used.) -tom