Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ncar!dinl!noren From: noren@dinl.uucp (Charles Noren) Newsgroups: comp.lang.c++ Subject: Static member definition vs. declaration? Message-ID: <1848@dinl.mmc.UUCP> Date: 17 Apr 91 14:39:43 GMT Reply-To: noren@dinl.UUCP (Charles Noren) Organization: Martin Marietta I&CS, Denver CO. Lines: 29 We have a debate in our group. When you declare a static member, such as: class X {static int myVar;}; Do you need to make a definition elsewhere, int X::myVar; I claim you do (and of course you want to initialize it at the same time). Others in my group say you don't and offer proof that our 2.0 and 2.1 Cfront compilers do fine without the "int X::myVar" statement. We all are aware of the holy writ (ARM) on page 179 and 405, but we vary on our interpretation of it. I claim our compilers permit an anachronism, the others think not. I now humbly come and submit myself to the Wisdom of the Network. What is the answer? ...and perhaps, if this is possible, could the answer include why it is the way it is. Much Thanks, -- Chuck Noren NET: dinl!noren@ncar.ucar.edu US-MAIL: Martin Marietta I&CS, MS XL8058, P.O. Box 1260, Denver, CO 80201-1260 Phone: (303) 977-1646