Hacker News new | ask | show | jobs
by optymizer 3038 days ago
The parent comment was referring to the usage of sizeof().

Also, the fact that they cast the result of malloc makes me think they were using a C++ compiler, which will complain that there's no cast.

2 comments

>The parent comment was referring to the usage of sizeof().

Ah ok, makes more sense in re-reading now. I was lazy and went off of a child comment.

>Also, the fact that they cast the result of malloc makes me think they were using a C++ compiler, which will complain that there's no cast.

Definitely could be that.

If you're compiling for C++, you should be using static_cast<> instead.