What's the benefit of declaring class functions separately from their actual functionality?
Posted
by vette982
on Stack Overflow
See other posts from Stack Overflow
or by vette982
Published on 2010-05-26T14:57:37Z
Indexed on
2010/05/26
15:01 UTC
Read the original article
Hit count: 191
In C++, what's the benefit of having a class with functions...
say
class someClass{
public:
void someFunc(int arg1);
};
then having the function's actual functionality declared after int main
int main()
{ return 0; }
void someClass::someFunc(int arg1)
{ cout<<arg1; }
Furthermore, what's the benefit of declaring the class in a .h header file, then putting the functionality in a .cpp file that #includes the .h file?
© Stack Overflow or respective owner