How to convert C++ operator to C?

Started by bitcoin, April 17, 2020, 12:04:39 PM

Previous topic - Next topic

bitcoin

Hello
I have trouble with C++ operator &

How to convert code to C. Such as:

DetourDetach(&(PVOID&)TrueMessageBoxA, MyMessageBoxA);

This don't compile with C and don't work without ampserdants. (lib is Microsoft Detours)

frankie

#1
This case ampersand in C++ means a reference to a variable. In C it behaves like a pointer.
But be careful: a reference is not a pointer in C++ (don't say something like that on stackoverflow or you'll get strongly and continuosly downvoted  ;D ;D ;D ;D ;D People don't read the contest just outline the first thing seemingly strange at them  ;D ;D ;D ;D)
The code is to be translated as:
DetourDetach(&TrueMessageBoxA, MyMessageBoxA);
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide