home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!mucs!lucs!scsr91
- From: scsr91@csc.liv.ac.uk (Mr. J.A. Coyne)
- Newsgroups: comp.lang.c++
- Subject: Creating arrays of a class object using default constructor
- Message-ID: <Bu7L6G.7C8@csc.liv.ac.uk>
- Date: 7 Sep 92 12:54:15 GMT
- Sender: news@csc.liv.ac.uk (News Eater)
- Organization: Computer Science, Liverpool University
- Lines: 46
- Nntp-Posting-Host: irw.csc.liv.ac.uk
-
- Using the HP version of AT&T release 2.1 compiler
-
- If I have the following classes
-
- class compound {
-
- basic * array; // pointer to class basic
-
- public:
-
- compound(); // class constructor function
-
- };
-
- //*************************************************
- compound::compound() {
-
- array = new basic[10];
-
- }
-
- //*************************************************
-
- which calls up the constructor for the class basic
-
-
- class basic {
-
- int * vector;
-
- public:
-
- basic(int =5) ;
-
- };
-
- //************************************************
-
- basic::basic(int size) {
-
- vector = new int[size];
-
- }
-
- The error message I recieve is : default arguments for constructor for array
- of class basic(2005)
-