How do i free up memory after malloc? Thanks

Started by
11 comments, last by NewbieA 20 years, 9 months ago
quote:Original post by Way Walker
If you''re using C, it''s considered bad style to cast void pointers.

Um, how are you supposed to allocate memory in C if you don''t cast void pointers? That''s what malloc returns.

Advertisement
I think WW was referring to the fact that an explicit cast is unnecessary, because C allows conversion from a void* to any other pointer type. (Yet another reason that C++ is NOT a superset of C).

How appropriate. You fight like a cow.
Thank you for all the helps. You guys are been very nice.

I will try out all the suggestions in the later time. Coz my computer (K6-2) has been down for a few days, and now i''m trying to getting it back working again...

Once again, thanks for all the helps.

This topic is closed to new replies.

Advertisement