interactive-tutorials icon indicating copy to clipboard operation
interactive-tutorials copied to clipboard

Issue in de/DynamicAllocation.md malloc & cast

Open HannHank opened this issue 4 years ago • 0 comments

The solution provided by the website is wrong and do not work, because the return value of malloc() need to be casted.

https://github.com/ronreiter/interactive-tutorials/blob/master/tutorials/learn-c.org/de/Dynamic%20allocation.md

could be done like this:

point * mypoint;
mypoint = static_cast<point*>(malloc(sizeof(point)));

HannHank avatar Aug 01 '21 14:08 HannHank