fork download
  1. #include <string>
  2. using namespace std;
  3.  
  4. class Item
  5. {
  6. private:
  7. string name;
  8. string desc;
  9. int itemId;
  10. public:
  11. Item(int id, string itemname, string description)
  12. : itemId(id)
  13. , name(itemname)
  14. , desc(description)
  15. {
  16. }
  17. };
  18.  
  19. class Weapon
  20. : public Item
  21. {
  22. private:
  23. string name;
  24. string desc;
  25. int itemId;
  26. int special;
  27. public:
  28. Weapon(int id, string itemname, string description, int attack)
  29. : Item(itemId, name, desc)
  30. , special(attack)
  31. {
  32. }
  33. };
  34.  
  35. int main()
  36. {
  37. Weapon test{ 1, "jeezum", "hdahdhd", 33 };
  38. }
  39.  
Runtime error #stdin #stdout 0s 3268KB
stdin
Standard input is empty
stdout
Standard output is empty