fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class IColor {
  5. public:
  6. virtual void print() = 0;
  7. };
  8.  
  9. class Color : public IColor {
  10.  
  11. };
  12.  
  13. class RGB : public Color {
  14. public:
  15. void print()
  16. {
  17. std::cout << "hi";
  18. }
  19. };
  20.  
  21. int main() {
  22. IColor* col = new RGB();
  23. col->print();
  24. return 0;
  25. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
hi