Create a class named SmartDynamicArray that dynamically allocates an array of integers in its constructor using std::unique_ptr. The size of the array should be specified as a parameter to the constructor. There must be a method that prints all the values
Stack or heap for OOP
Smart dynamic array
Report a typo
Sample Input 1:
2 3 4Sample Output 1:
Array values: 3 4Write a program in C++ 20
class SmartDynamicArray {
private:
std::unique_ptr<int[]> array;
int size;
public:
};
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.