Reputation: 53
In my C program I am using void* pointers. Is there anyway to check in an if statement if the void* pointer is pointing to an int* or a char*?
Upvotes: 2
Views: 236
Reputation: 137398
Nope. There is no run-time type information in C. A void*
is just an address. That's it. It's completely up to the programmer to know / keep track of what information a void*
points to.
With more information about how/why you're using void*
, a workaround could possibly be suggested.
Upvotes: 8