delorie.com/archives/browse.cgi | search |
From: | G DOT DegliEsposti AT ads DOT it |
To: | "Robert Lazorko" <rlazorko AT geocities DOT com> |
cc: | djgpp AT delorie DOT com |
Message-ID: | <C1256568.00371C41.00@vega.ads.it> |
Date: | Tue, 9 Dec 1997 11:04:26 +0100 |
Subject: | Re: Return Types for Constructors |
Mime-Version: | 1.0 |
>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! ... }
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |