fork(1) download
  1. #include <iostream>
  2. using namespace std; // consider removing this line in serious projects
  3.  
  4. class Car{
  5. private:
  6. int speed;
  7. public:
  8. void slowDown();
  9. void speedUp();
  10. };
  11.  
  12. void Car::slowDown(){
  13. speed -= 5;
  14. }
  15.  
  16. void Car::speedUp(){
  17. speed += 5;
  18. }
  19.  
  20. int main() {
  21. Car BMW;
  22. BMW.speedUp();
  23. BMW.slowDown();
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty