- Implement `printArrayAtPosition` in `functions.cpp` with input validation. - Created `main.cpp` to demonstrate array operations using C arrays and `std::vector`. - Updated `ClassA` and `IComparable` with constructors, destructors, and deep copy logic. - Adjusted IntelliJ project configuration for new containers module.
31 lines
600 B
C++
31 lines
600 B
C++
#ifndef CLASSES_CLASSA_H
|
|
#define CLASSES_CLASSA_H
|
|
#include "IComparable.h"
|
|
|
|
|
|
class ClassA : public IComparable {
|
|
// private
|
|
|
|
public:
|
|
// public
|
|
ClassA(); // default constructor
|
|
ClassA(const ClassA& other); // copy constructor
|
|
~ClassA() override; // destructor
|
|
|
|
void Print();
|
|
int CompareTo(IComparable* other) override;
|
|
|
|
const float& GetDecimal() const { return *_pDecimal; }
|
|
void SetDecimal(float decimal) { *_pDecimal = decimal; }
|
|
|
|
protected:
|
|
// protected
|
|
|
|
private:
|
|
// private
|
|
int _number = 0;
|
|
float* _pDecimal = nullptr;
|
|
};
|
|
|
|
|
|
#endif //CLASSES_CLASSA_H
|