Why people do not deallocate c-style strings?
const char* string = "Whatever";
And how does it work actually, because there is no some kind of new
or malloc
?
Why people do not deallocate c-style strings?
const char* string = "Whatever";
And how does it work actually, because there is no some kind of new
or malloc
?
For the given string there is no memory allocation on the heap.
An array of chars "Whatever"
is created in the const section. The address of this array is given to the pointer string