fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. struct Ammo
  6. {
  7. public:
  8. const int MAX_MAGAZINES;
  9. const int MAX_IN_MAGAZINE;
  10. int currMagazineAmmo;
  11. int totalAmmo;
  12. Ammo(int maxMag, int maxMagAmmo) : MAX_MAGAZINES(maxMag), MAX_IN_MAGAZINE(maxMagAmmo)
  13. {
  14. currMagazineAmmo = totalAmmo = 0;
  15. }
  16. ~Ammo()
  17. {
  18.  
  19. }
  20. bool MagazineNotEmpty() {return currMagazineAmmo > 0;}
  21. bool NotEmpty() {return totalAmmo > 0;}
  22. };
  23.  
  24.  
  25. int main() {
  26.  
  27. Ammo gun(10,40);
  28. std::cout << gun.MAX_MAGAZINES;
  29.  
  30. return 0;
  31. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
10