Guest User

Untitled

a guest
Jun 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. // header file
  2. class Foo
  3. {
  4. public:
  5. static int bar;
  6. int baz;
  7. int adder();
  8. };
  9.  
  10. // implementation
  11. int Foo::adder()
  12. {
  13. return baz + bar;
  14. }
  15.  
  16. int Foo::bar = you_initial_value_here;
  17.  
  18. int Foo::bar = 0; // or whatever value you want
  19.  
  20. int Foo::bar;
  21.  
  22. class Foo {
  23. static int bar;
  24. int adder();
  25. };
  26.  
  27. int Foo::bar=0;
  28. int Foo::adder() { ... }
Add Comment
Please, Sign In to add comment