Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. /*
  2.  * Array.h
  3.  *
  4.  *  Created on: Oct 17, 2010
  5.  *      Author: Peter
  6.  */
  7.  
  8. #ifndef ARRAY_H_
  9. #define ARRAY_H_
  10.  
  11. #include <iostream>
  12. using namespace std;
  13.  
  14. template < typename T >
  15. class Array {
  16. public:
  17.     Array(int = 10); // Default constructor (Array object with 10 elements
  18.     ~Array(); // Destructor
  19.     int getSize() const;
  20.     bool operator==(const Array &anotherArray) const;
  21.     bool operator!=(const Array &anotherArray) const;
  22.     T &operator[](int subscript); // subscript operator
  23.     static int getArrayCount(); // return count of arrays instantiated
  24.     void inputArray();
  25.     void outputArray() const; // output the array elements
  26. private:
  27.     T* elements;
  28.     static int arrayCount; // # of Arrays instantiated
  29. };
  30.  
  31. #endif /* ARRAY_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement