From: G DOT DegliEsposti AT ads DOT it To: "Robert Lazorko" cc: djgpp AT delorie DOT com Message-ID: Date: Tue, 9 Dec 1997 11:04:26 +0100 Subject: Re: Return Types for Constructors Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Precedence: bulk >I am writing code which implements classes for C++, and yet, the compiler >gives the error >message "return type specified for constructor invalid"... > >The code I have used is (I have excluded the header info): > >Vector::Vector() >{ > x = 0; > y = 0; >} Seems correct... maybe the error is in the header info you omitted. you have to declare the constructor like this: class Vector { ... Vector(); // without specifying the return type! ... }