Sorry but your comment is a little bit to short to be understanable for me.
I guess you want to tell me that I try to delete an array. But is this realy the case if I write
char* Word = new char[Size+1];
Until now I thought that word is a pointer and with new I create an array in the heap. Thus my understanding is that I have to delete it again to free the allocated memmory.
Could you please extend your comment to explain what you mean?
Thank you very much,
Eckard Klotz.
Last edit: Eckard Klotz 2016-04-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Everybody.
I get the following CppCheck output with the code-fragment below:
What is my mistake?
Best regards,
Eckard Klotz.
Last edit: Eckard Klotz 2016-04-18
delete [] Word ?
Hello Prozak.
Sorry but your comment is a little bit to short to be understanable for me.
I guess you want to tell me that I try to delete an array. But is this realy the case if I write
Until now I thought that word is a pointer and with new I create an array in the heap. Thus my understanding is that I have to delete it again to free the allocated memmory.
Could you please extend your comment to explain what you mean?
Thank you very much,
Eckard Klotz.
Last edit: Eckard Klotz 2016-04-19
Hi Eckard,
if you allocate memory for array using new [] operator, it should be deleted with delete [] operator.
For more information please see:
http://www.cplusplus.com/reference/new/operator%20delete[]/
Regards,
prozak
Hello Prozak.
Yes now I understand. Thanks for your explanation and the link.
Best regards,
Eckard.