What are the reasons for casting a void pointer?

Posted by Maulrus on Stack Overflow See other posts from Stack Overflow or by Maulrus
Published on 2010-04-07T06:00:31Z Indexed on 2010/04/07 6:03 UTC
Read the original article Hit count: 257

Filed under:
|

I'm learning C++ from scratch, and as such I don't have an expert understanding of C. In C++, you can't cast a void pointer to whatever, and I understand the reasons behind that. However, I know that in C, you can. What are the possible reasons for this? It just seems like it's be a huge hole in type safety, which (to me) seems like a bad thing.

© Stack Overflow or respective owner

Related posts about c

    Related posts about best-practices