fork download
  1. #include <string>
  2. #include <vector>
  3. #include <iostream>
  4.  
  5. typedef std::vector<bool> boolArray;
  6. typedef std::vector<boolArray> boolArray2D;
  7. typedef std::vector<boolArray2D> boolArray3D;
  8.  
  9. class airMap
  10. {
  11. public:
  12. airMap( int, int, int,std::string);
  13. boolArray3D& getArray() { return matrix3D; }
  14. std::string name() const { return generatorName; }
  15.  
  16. private:
  17. std::string generatorName;
  18. boolArray3D matrix3D;
  19. };
  20.  
  21. //Constructeurs et destructeurs
  22. airMap::airMap(int x=0,int y=0,int z=0,std::string gen="EMPTY") :
  23. matrix3D(x, boolArray2D(y, boolArray(z))), generatorName(gen)
  24. {
  25. }
  26.  
  27. using namespace std;
  28.  
  29. int main()
  30. {
  31. airMap a1(10,11,12,"abc");
  32. airMap a2 = a1;
  33. cout << a1.name() << " " << a1.getArray()[0][0][0] << "\n";
  34. cout << a2.name() << " " << a2.getArray()[0][0][0] << "\n";
  35. }
Success #stdin #stdout 0s 3416KB
stdin
Standard input is empty
stdout
abc 0
abc 0