🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c++
Article #283

Quirk in constructors in version 1.1.

#283
From: Stephen J. Muir
Date: Thu, 14 Aug 1986 06:44
24 lines
1210 bytes
The following program fails to compile.  The compiler wants a second argument
for the the declaration "x z;".  It works fine with only one argument in the
constructor, or if the words "const" are deleted.

# include <stream.h>

class x
	{ char	*save;
public:
	  x(const char *a = 0, const int b = 0)	{ cout << "Initialize\n"; }
	  ~x()	{ cout << "Clean up\n"; }
	};

x z;

main ()
{
	cout << "Hello, world\n";
}
-- 
EMAIL:	stephen@comp.lancs.ac.uk	| Post: University of Lancaster,
UUCP:	...!mcvax!ukc!dcl-cs!stephen	|	Department of Computing,
Phone:	+44 524 65201 Ext. 4120		|	Bailrigg, Lancaster, UK.
Project:Alvey ECLIPSE Distribution	|	LA1 4YR
Technical Details
Message-ID: <351@comp.lancs.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!ukc!dcl-cs!stephen

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!ukc!dcl-cs!stephen
From: stephen@comp.lancs.ac.uk (Stephen J. Muir)
Newsgroups: net.lang.c++
Subject: Quirk in constructors in version 1.1.
Message-ID: <351@comp.lancs.ac.uk>
Date: Thu, 14-Aug-86 02:44:11 EDT
Article-I.D.: comp.351
Posted: Thu Aug 14 02:44:11 1986
Date-Received: Fri, 15-Aug-86 06:39:56 EDT
Reply-To: stephen@comp.lancs.ac.uk (Stephen J. Muir)
Organization: Department of Computing at Lancaster University, UK.
Lines: 24