🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.lang.learn.c-c++
Article #544

Will I encounter problems with this?

#544
From: Mike K
Date: Tue, 08 Oct 2002 22:49
26 lines
2052 bytes
This is a student's, not a school question. I'm just learning C++.
Just a quick example. Remember hearing something about this being wrong, but
can't rembember. If so, why?

class MyClass {
  int x, y, z;
public:
  MyClass(void) {
    Reset();
  }

  MyClass(int x, int y) {
    Reset();
    _x = x; _y = y;
  }

  void Reset(void) {
    _x = _y = _z = 0;
  }
};

I can't remember what the problem with calling a member function during
construction is (if any). It seems this way would be easier to add another
variable to a class, without rewriting all the constructors. Please advise.

Mike
Technical Details
Message-ID: <6iJo9.212959$8b1.66337@news01.bloor.is.net.cable.rogers.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!washdc3-snf1!news.gtei.net!cyclone1.gnilink.net!ps01-chi1!newsfeeds-atl2!news.webusenet.com!news03.bloor.is.net.cable.rogers.com!news01.bloor.is.net.cable.rogers.com.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114592,61800715a4dea40c,start
X-Google-Attributes: gid114592,public
X-Google-Thread: 109fba,61800715a4dea40c,start
X-Google-Attributes: gid109fba,public
X-Google-Thread: 10f40d,61800715a4dea40c,start
X-Google-Attributes: gid10f40d,public
X-Google-Thread: 102541,61800715a4dea40c,start
X-Google-Attributes: gid102541,public
X-Google-ArrivalTime: 2002-10-08 15:49:40 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!washdc3-snf1!news.gtei.net!cyclone1.gnilink.net!ps01-chi1!newsfeeds-atl2!news.webusenet.com!news03.bloor.is.net.cable.rogers.com!news01.bloor.is.net.cable.rogers.com.POSTED!not-for-mail
From: "Mike K" <mkipper@rogers.com>
Newsgroups: alt.comp.lang.learn.c-c++,borland.public.cppbuilder,borland.public.cppbuilder.students,comp.lang.c++
Subject: Will I encounter problems with this?
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <6iJo9.212959$8b1.66337@news01.bloor.is.net.cable.rogers.com>
Date: Tue, 08 Oct 2002 22:49:38 GMT
NNTP-Posting-Host: 24.101.95.126
X-Complaints-To: abuse@rogers.com
X-Trace: news01.bloor.is.net.cable.rogers.com 1034117378 24.101.95.126 (Tue, 08 Oct 2002 18:49:38 EDT)
NNTP-Posting-Date: Tue, 08 Oct 2002 18:49:38 EDT