fredcrs
(usa Debian)
Enviado em 09/02/2009 - 09:52h
achei isso aqu no google mas eu achava q no .h tbm tinha q botar inline:
When you declare an inline member function, it looks just like a normal member function:
class Fred {
public:
void f(int i, char c);
};
But when you define an inline member function, you prepend the member function's definition with the keyword inline, and you put the definition into a header file:
inline
void Fred::f(int i, char c)
{
...
}
It's usually imperative that the function's definition (the part between the {...}) be placed in a header file. If you put the inline function's definition into a .cpp file, and if it is called from some other .cpp file, you'll get an "unresolved external" error from the linker.