vimix

VarArray.h

Apr 2nd, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. // variable size array class
  2. // Mikhail Nesterenko
  3. // 11/06/2009
  4.  
  5.  
  6. #ifndef VARARRAY_H_
  7. #define VARARRAY_H_
  8.  
  9. #include <iostream>
  10.  
  11. using namespace std;
  12.  
  13. class varArray{
  14. public:
  15. varArray(void); // void constructor
  16. void sortNumber();
  17. void addNumber(int); // adds number to the array
  18. void removeNumber(int); // deletes the number from the array
  19. void output(void); // prints the values of the array in sorted order
  20.  
  21. // big three
  22. varArray(const varArray&); // copy constructor
  23. varArray& operator=(const varArray&); // overloaded assignment
  24. ~varArray(void); // destructor
  25.  
  26. private:
  27. int *array; // pointer to the dynamically allocated array
  28. int size; // array size
  29. };
  30.  
  31. #endif /* VARARRAY_H_ */
Advertisement
Add Comment
Please, Sign In to add comment