Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // header file
- class Foo
- {
- public:
- static int bar;
- int baz;
- int adder();
- };
- // implementation
- int Foo::adder()
- {
- return baz + bar;
- }
- int Foo::bar = you_initial_value_here;
- int Foo::bar = 0; // or whatever value you want
- int Foo::bar;
- class Foo {
- static int bar;
- int adder();
- };
- int Foo::bar=0;
- int Foo::adder() { ... }
Add Comment
Please, Sign In to add comment