fork download
  1. #include <iostream>
  2. #include <cstdlib>
  3. class CSDLGameObject
  4. {
  5. public:
  6. CSDLGameObject() {m_PosX = 0;
  7. m_PosY = 0;}
  8. void print()
  9. {
  10. std::cout << "Test";
  11. }
  12.  
  13. protected:
  14. int m_PosX;
  15. int m_PosY;
  16.  
  17. };
  18.  
  19. class CGoombas : public CSDLGameObject
  20. {
  21. public:
  22. CGoombas();
  23. };
  24.  
  25. CGoombas::CGoombas() : CSDLGameObject() //Here is the error
  26. {
  27. m_PosX = 400;
  28. m_PosY = 300;
  29. }
  30.  
  31. int main()
  32. {
  33. CGoombas goombas;
  34.  
  35. goombas.print();
  36.  
  37. return 0;
  38. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
Test