Modify a given matrix by placing sorted boundary elements in clockwise manner

#include
using namespace std;
  

void printMatrix(vector a)
{
    for (auto x : a) {
        for (auto y : x) {
            cout = n_l; –i) {
                a[n_m – 1][i] = boundary[ind++];
            }
            n_m–;
        }
  
        
        if (n_l < n_n) {             for (i = n_m - 1; i >= n_k; –i) {
                a[i][n_l] = boundary[ind++];
            }
            n_l++;
        }
    }
  
    
    printMatrix(a);
}
  

int main()
{
    
    vector matrix = { { 9, 7, 4, 5 },
                                    { 1, 6, 2, -6 },
                                    { 12, 20, 2, 0 },
                                    { -5, -6, 7, -2 } };
  
    sortBoundaryWise(matrix);
  
    return 0;
}