Reply to post: Re: void *

Riddle me this: TypeScript's latest data type is literally unknown

Dan 55 Silver badge

Re: void *

Nobody's talking about overloading. If you are juggling a bunch of void * variables about and calling a bunch of functions which accept void *s, or you are forced to cast to void * in the function call, you can pass the wrong variable to the wrong function. However, if you define the function to accept an opaque structure pointer instead of a void * then the compiler will enforce type checking and you can't make that mistake.

Or you don't understand why void* exists and why its sometimes required as a function parameter.

Okay, so tell me why I'm wrong and what your example is.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon