A small problem about delete in CPP

Do you need to manually delete a pointer defined in the

CPP function (not the main function) at the end of the function? Or will the system automatically delete?
as at the end of this code, is that delete redundant?

void mergeArray(int * & A, int low, int high)
{
    int cnt = 0;
    int * B = new int[high - low + 1];
    int mid = low + (high - low) / 2;
    int i = low;
    int j = mid + 1;
    while( mid + 1 > i && high + 1 > j ) {
        if ( A[i] < A[j] )    B[cntPP] = A[iPP];
        else    B[cntPP] = A[jPP];
    }
    while( mid + 1 > i )    B[cntPP] = A[iPP];
    while( high + 1 > j )    B[cntPP] = A[jPP];
//    A:loop from low, B:loop from 0 
    for ( i = low, cnt = 0; i < high + 1; iPP )    A[i] = B[cntPP];
    delete[] B;
}
CPP
Mar.06,2021

new opens memory on the heap. Unless the whole process ends, it will be reclaimed by the operating system. Otherwise, the variables in memory are still there after the end of the function

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3d38e-2c38c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3d38e-2c38c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?