Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!fornax!miron From: miron@fornax.UUCP (Miron Cuperman) Newsgroups: comp.lang.c++ Subject: Re: Array of class objects Keywords: array, initialization, class objects Message-ID: <1650@fornax.UUCP> Date: 23 Nov 90 21:47:21 GMT References: <1756@enuxha.eas.asu.edu> <1990Nov15.050358.16043@clear.com> Organization: School of Computing Science, SFU, Burnaby, B.C. Canada Lines: 17 rmartin@clear.com (Bob Martin) writes: >>class pnt {... >> pnt (int x = 0, int y = 0, int z = 0) {X=x; Y=y; Z=z;} >>}; >>I recieve an error to the effect "cannot find pnt::pnt()" when >>I compile my program. >So the solution is for you to declare and implement a pnt::pnt() >constructor. Perhaps it should set the coordinates to zero... No. pnt::pnt() is defined, since all the arguments to pnt(int, int, int) are optional. It may be that there is a bug in your compiler, or that it is not up to date. If not you define pnt::pnt(), then it would be ambigous which version of pnt::pnt() to call.