A couple of comments:
1) It is always good to create constructors for all classes.
2) You have forgotten a semicolon at the end of the class declaration.
This makes it a declaration of a data type to be returned by sayHello().
Besides, sayHello() then specifies two return types: "class CBruchzahlen"
and "void".
/Per W
On Sat, 19 Mar 2005, Markus D=FCrauer LM wrote:
> Need help!
> When compiling the following dev-c++ project I get some errors:
>
> #include <iostream>
> using namespace std;
> int main(int argc, char *argv[])
> {
> int a;
> a =3D cin.get();
> }
> class CBruchzahlen
> {
> private:
> long lZaehler;
> long lNenner;
>
> public:
> void sayHello(char * message);
>
> }
> void CBruchzahlen::sayHello(char * message)
> {
> =09cout << "Test";
> }
>
> Errors:
> -) new types may not be defined in a return type
> -) two or more data types in declaration of `sayHello'
> -) prototype for `CBruchzahlen CBruchzahlen::sayHello(char*)' does not ma=
tch
> any in class `CBruchzahlen'
>
> Can anyone help?
>
> Markus
|