help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Undefined references to variable problem


From: Simon Buchan
Subject: Re: Undefined references to variable problem
Date: Fri, 30 Sep 2005 16:12:15 +1200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

BobR wrote:
Brian Arnold wrote in message
<1125252885.152925.18270@g14g2000cwa.googlegroups.com>...

You're absolutely right. I can't believe I missed that. I had

size_t Object::_sharkcount = 0;

but no equivalent version for _supersharkcount. That fixed it! Thank
you so much!



[ from a FAQ ]
"Avoid a name that will begin with an underscore, as most of those names are
reserved for compiler vendors."

Are you a 'compiler vendor'? <G>

More accurately, names begining with /two/ underscores, or an underscore followed by a capital are reserved for the vendor by the standard, ie:
__special_vendor_name,
_Special_vendor_name2.
Just an underscore is generally fine, especially uglifing variables for class initialisation:

        class X {
                int y;
        public:
                X(int _y) : y(_y) {}
        };





reply via email to

[Prev in Thread] Current Thread [Next in Thread]