In C, is it good form to use typedef for a pointer?

If the pointer is never meant to be dereferenced or otherwise manipulated directly — IOW, you only pass it as an argument to an API — then it’s okay to hide the pointer behind a typedef.

Otherwise, it’s better to make the “pointerness” of the type explicit.

Leave a Comment