Start New Discussion within our Software Development Community

when i,

g++ -c

compiler says: error: semicolon missing after declaration of `Serdar' error: ISO C++ forbids defining types within return type error: two or more data types in declaration of `SetValue' error: prototype for `Serdar Serdar::SetValue(const int&)' does 
   not match any in class `Serdar'
Serdar.hh:5: error: candidate is: void Serdar::SetValue(const int&) error: `Serdar Serdar::SetValue(const int&)' and `void 
   Serdar::SetValue(const int&)' cannot be overloaded error: semicolon missing after declaration of `class Serdar' In member function `int& Serdar::GetValue()': error: request for member `deger' in `this', which is of 
   non-class type `Serdar* const'

Serdar.hh file:

class Serdar
                void SetValue(const int &a);
                int & GetValue();
                int deger;
} file:

#include "Serdar.hh"
void Serdar::SetValue(const int &a)
        deger = a;
int & Serdar::GetValue()
        return & this.deger;

Don't class declarations need a semicolon after 'em?

int & Serdar::GetValue()
That looks odd. Might be ok ain't checked it.

This question has already been answered. Start a new discussion instead.