Add dynamic operator overloading functions to a 2D Matrix class:
int rows, int cols, int** data (dynamically allocated 2D integer array).Matrix(int r, int c) allocating memory and initializing elements.Matrix(const Matrix& other) performing deep copy.~Matrix() releasing dynamic 2D memory with delete[].operator=): Deep copy with self-assignment guard (if (this != &other)).operator+): Element-wise addition for equal dimensions.operator-): Element-wise subtraction for equal dimensions.operator*): Dot product matrix multiplication (r1 x c1) * (c1 x c2) -> (r1 x c2).set(int r, int c, int val) and display() const.A + B, A - B, A * B, and assignment C = A.Matrix A (2x2): [ 1 2 ] [ 3 4 ] Matrix B (2x2): [ 5 6 ] [ 7 8 ] Matrix Addition (A + B): [ 6 8 ] [ 10 12 ] Matrix Subtraction (A - B): [ -4 -4 ] [ -4 -4 ] Matrix Multiplication (A * B): [ 19 22 ] [ 43 50 ] [✓] Matrix dynamic operators verified (Time: 0.009s, Memory: 2.2 MB)