Thread View: net.lang.c++
1 messages
1 total messages
Started by Stephen J. Muir
Thu, 14 Aug 1986 06:44
Quirk in constructors in version 1.1.
Author: Stephen J. Muir
Date: Thu, 14 Aug 1986 06:44
Date: Thu, 14 Aug 1986 06:44
24 lines
1210 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads