I have the following code :
#include <stdio.h>
typedef void* myHandle;
int main() {
int a = 1;
myHandle Handle = &a;
printf("%d\n",*Handle);
return 0;
}
Question 1: usually, if I have a pointer of type integer, I can use the dereference operator and get the value of the integer variable. However, in this example, I have a void pointer type, how can I dereference it's contents? it gives me a syntax error
Also, I want to use myHandle like how win32 API use it with HANDLE, I'm doing this for the purpose of only learning how windows does it. From what I get, is that HANDLE is used to reference all related resources. I've read win32 API and saw how a function passes a HANDLE variable to append the address of the contents created to the HANDLE which is pretty cool.
So Question 2: : how can I append addresses to my handle and then access them later like how win32 API does?