In the line // 1 operator new[] should be used, to which the memory size needed for an array should be passed. Since sizeof(char) == 1, in this case, it's not necessary to multiply the number of elements in the array by sizeof(char).
In the line // 2, character literal should be used instead of string literal.
In the line // 4 operator delete[] should be used, since memory for an array was allocated by the operator new[].
Войдите чтобы поставить Нравится
Войдите чтобы прокомментировать