HI guys,
I read in a book that 'inline function' should be defined in evey file where it's used'; so it's better define it after class declaration:
//person.h
class Person{
private:
string name;
public:
Person();
~Person();
string getName() const {return name;}
inline void setName (const string n);
};
inline void Person::setName(const string n) {
this->name = n;
}
//person.h
class Person{
private:
string name;
public:
Person();
~Person();
string getName() const {return name;}
inline void setName (const string n);
};
inline void Person::setName(const string n) {
this->name = n;
}
To copy to clipboard, switch view to plain text mode
in this way it work! But I remember that my prevoius code work with .net; could anyone confirm that? thanks
Bookmarks