If the file is .c MSVC will compile.
If it’s .cpp it "cannot convert from 'void *' to 'unsigned char *'"
I’m using the MEMORY_BASIC_INFORMATION::BaseAddress in windows.h which is void*, assigning it to a char* so I can see the actual address you know?
When I cast it to char*, and later back to void* (to use it in windows functions), it like bugs out and loses data or something
What to do?
In C++, you must use an explicit cast to convert a
void*to anything else:This is indeed different from the situation in C, where a
void*can be implicitly converted to any other pointer type. The reverse situation is still as in C:However, I don’t see why you’d need a
char*to “see the actual address” as avoid*can be printed as-is byoperator<<onstd::ostreamand bystd::printfwith%p.