// -*- coding: utf-8 -*- // Time-stamp: // Class for arrays of floats #ifndef ARRAY_H #define ARRAY_H class Array { public: // Constructors // Default constructor: no allocation Array(); // Constructor from a size Array(int n); // Copy constructor Array(const Array& a); // Assignment operator Array& operator=(const Array& a); // Access operators // Access operator to non constant objets double& operator[](int i); // Access operator to constant objets const double& operator[](int i) const; // Destructor ~Array(); // Size int size() const { return length; } private: int length; // Size of the dynamic array double *p; // Address of the dynamic array or nullptr if none }; #endif