memblock = (char *)malloc( currentByteLength);
memblock = new char[currentByteLength];
Now there is no difference. But if you replace charwith int, then yes, there will be a difference, because in this case it mallocwill allocate memory by size currentByteLength, and it newwill allocate memory by size size(int) * currentByteLength. Therefore, be very careful.
Also, if the type referenced in the expression newis a user-defined type, then the default constructor will be called the currentByteLengthnumber of times to construct objects!
!