diff options
feat(Week05): Add solutions
1 files changed, 27 insertions, 0 deletions
| -rw-r--r-- | Week05/Exercise01/NumSeries.h | 27 |
diff --git a/Week05/Exercise01/NumSeries.h b/Week05/Exercise01/NumSeries.h new file mode 100644 index 0000000..b7d89a7 --- /dev/null +++ b/Week05/Exercise01/NumSeries.h @@ -0,0 +1,27 @@ +#ifndef NUMSERIES +#define NUMSERIES + +class NumSeries { + double* numbers; + unsigned allocated; + unsigned size; + + void free(); + void copyFrom(const NumSeries& other); + + void resize(); +public: + NumSeries(); + ~NumSeries(); + NumSeries(const NumSeries& other); + NumSeries& operator=(const NumSeries& other); + + NumSeries(NumSeries&& other); + NumSeries& operator=(NumSeries&& other); + + void Push(double element); + double At(unsigned index) const; + unsigned Length() const; +}; + +#endif /* NUMSERIES */ |
