generic programming in C with void pointer.

Posted by Nyan on Stack Overflow See other posts from Stack Overflow or by Nyan
Published on 2010-03-16T15:21:46Z Indexed on 2010/03/16 15:31 UTC
Read the original article Hit count: 306

Filed under:
|
|
|

Hi everyone, even though it is possible to write generic code in C using void pointer(generic pointer), I find that it is quite difficult to debug the code since void pointer can take any pointer type without warning from compiler. (e.g function foo() take void pointer which is supposed to be pointer to struct, but compiler won't complain if char array is passed.) What kind of approach/strategy do you all use when using void pointer in C?

© Stack Overflow or respective owner

Related posts about c

    Related posts about c++