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:
@@ -0,0 +1,16 @@
|
||||
#include "functions.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
void printArrayAtPosition(int* array, int position) {
|
||||
if (array == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (position < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::cout << "size of array: " << sizeof(array) << std::endl;
|
||||
std::cout << array[position] << std::endl;
|
||||
}
|
||||
Reference in New Issue
Block a user