1//ClassOne.hpp:
2
3class ClassOne
4{
5public:
6 ClassOne(); // note, no function body
7 int method(); // no body here either
8private:
9 int member;
10};
11//ClassOne.cpp:
12
13#include "ClassOne.hpp"
14
15// implementation of constructor
16ClassOne::ClassOne()
17 :member(0)
18{}
19
20// implementation of "method"
21int ClassOne::method()
22{
23 return member++;
24}
25//main.cpp:
26
27#include "ClassOne.hpp" // Bring the ClassOne declaration into "view" of the compiler
28
29int main(int argc, char* argv[])
30{
31 ClassOne c1;
32 c1.method();
33
34 return 0;
35}