fork(1) download
  1. // this goes in your header (.h) file
  2. class Example {
  3. public:
  4. void print_thing(int);
  5. };
  6. // end header file
  7.  
  8.  
  9. // from here on is the .cpp file
  10. #include <iostream>
  11.  
  12. void Example::print_thing(int x) {
  13. std::cout << "Your integer is " << x << std::endl;
  14. }
  15.  
  16. int main() {
  17. Example e;
  18. e.print_thing(5);
  19. }
  20.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Your integer is 5