Article View: alt.comp.lang.learn.c-c++
Article #548Re: Will I encounter problems with this?
From: Homer Meyer
Date: Tue, 08 Oct 2002 23:25
Date: Tue, 08 Oct 2002 23:25
20 lines
2122 bytes
2122 bytes
"Jacques Labuschagne" <hardwired@xtra.co.nz> wrote in message
news:owJo9.5131$Os6.704244@news.xtra.co.nz...
> Mike K wrote:
> > MyClass(int x, int y) {
> > Reset();
> > _x = x; _y = y;
>
> No member named _x or _y. You called them plain old x and y.
> I'd recommend using x_ and y_, as names starting with an underscore
> are generally reserved for use by the implementation.
Names containing two consecutive underscores and names starting with an
underscore followed by an uppercase letter are reserved for the
implementation everywhere.
Names starting with an underscore followed by a lower case letter are
reserved for the implementation only in the global namespace.
So in this case the OP is ok, but the rules are hard enough to remember that
always avoiding names starting with an underscore is good advice.
Technical Details
Message-ID:
<uq6qbn95lgch6b@news.supernews.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news-feed.riddles.org.uk!sn-xit-03!sn-xit-06!sn-post-01!supernews.com!news.supernews.com!not-for-mailReferences:
<6iJo9.212959$8b1.66337@news01.bloor.is.net.cable.rogers.com> <owJo9.5131$Os6.704244@news.xtra.co.nz>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10f40d,61800715a4dea40c X-Google-Attributes: gid10f40d,public X-Google-Thread: 102541,61800715a4dea40c X-Google-Attributes: gid102541,public X-Google-Thread: 109fba,61800715a4dea40c X-Google-Attributes: gid109fba,public X-Google-Thread: 114592,61800715a4dea40c X-Google-Attributes: gid114592,public X-Google-ArrivalTime: 2002-10-08 16:29:29 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news-feed.riddles.org.uk!sn-xit-03!sn-xit-06!sn-post-01!supernews.com!news.supernews.com!not-for-mail From: "Homer Meyer" <homer@cqg.com> Newsgroups: alt.comp.lang.learn.c-c++,borland.public.cppbuilder,borland.public.cppbuilder.students,comp.lang.c++ Subject: Re: Will I encounter problems with this? Date: Tue, 8 Oct 2002 17:25:42 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <uq6qbn95lgch6b@news.supernews.com> References: <6iJo9.212959$8b1.66337@news01.bloor.is.net.cable.rogers.com> <owJo9.5131$Os6.704244@news.xtra.co.nz> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Complaints-To: abuse@supernews.com Lines: 23