Incompatible Class Declaration c++
问题 I have class NumberArray in NumberArray.h class NumberArray { private: double *aPtr; int arraySize; public: NumberArray(int size, double value); // ~NumberArray() { if (arraySize > 0) delete [ ] aPtr;} //commented out to avoid problems with the //default copy constructor void print() const; void setValue(double value); }; When I go to write the print function in NumberArray.cpp void NumberArray::print() { for (int index = 0; index < arraySize; index++) cout << aPtr[index] << " "; } It gives