Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!brunix!doorknob!mlm From: mlm@cs.brown.edu (Moises Lejter) Newsgroups: comp.lang.c++ Subject: Re: Array of class objects Message-ID: Date: 26 Nov 90 04:31:19 GMT References: <1756@enuxha.eas.asu.edu> <1990Nov15.050358.16043@clear.com> <1650@fornax.UUCP> Sender: news@brunix.UUCP Reply-To: mlm@cs.brown.edu Organization: Department of Computer Science, Brown University Lines: 21 In-reply-to: miron@fornax.UUCP's message of 23 Nov 90 21:47:21 GMT About the two constructors: pnt::pnt( int x = 0, int y = 0, int y = 0 ) {}; pnt::pnt() {}; Under AT&T C++ 2.0, these were in fact two different constructors, and in order to initialize an array of pnt's it was necessary to include the second one. Under AT&T C++ 2.1, that restriction was lifted, and the first constructor will be used to initialize arrays of pnt's, if the second constructor is not supplied. Under either compiler, I believe that including both versions of the constructor and then defining a variable pnt P; will result in a compile-time error on that line, as the compiler will be unable to disambiguate that call. Moises -- ----------------------------------------------------------------------------- Internet/CSnet: mlm@cs.brown.edu BITNET: mlm@browncs.BITNET UUCP: ...!uunet!brunix!mlm Phone: (401)863-7664 USmail: Moises Lejter, Box 1910 Brown University, Providence RI 02912