Add containers project with CMake setup and array-related functionality
- 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.
This commit is contained in:
@@ -8,15 +8,23 @@ class ClassA : public IComparable {
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user