0
char *s; s=new char[30]; Question in the description.
I was wondering how would compiler see this. We declared a character pointer first. And then we declared the memory space the pointer is going to be targeting upon (If I am not wrong). But what if the value of the string 's' is less than 30, then what happens to the rest of the memory?
2 ответов
+ 3
The pointer definition must be done before assigning something to it. The rest of the memory is wasted for the variables lifetime.
0
Sandra Meyer is there a way to release it?