Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Array.h
- *
- * Created on: Oct 17, 2010
- * Author: Peter
- */
- #ifndef ARRAY_H_
- #define ARRAY_H_
- #include <iostream>
- using namespace std;
- template < typename T >
- class Array {
- public:
- Array(int = 10); // Default constructor (Array object with 10 elements
- ~Array(); // Destructor
- int getSize() const;
- bool operator==(const Array &anotherArray) const;
- bool operator!=(const Array &anotherArray) const;
- T &operator[](int subscript); // subscript operator
- static int getArrayCount(); // return count of arrays instantiated
- void inputArray();
- void outputArray() const; // output the array elements
- private:
- T* elements;
- static int arrayCount; // # of Arrays instantiated
- };
- #endif /* ARRAY_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement