I just learned C++ style casting and the 4 types of casts. I'm not sure if I'm abusing it though.
Examples:
typedef long (*stringFromString)(int, char*) __cdecl;
//TO:
typedef long static_cast<*stringFromString>((int, char*)) __cdecl;
SmartSetup((char*)World.c_str(), (char*)",f5", 765, 503,(char*)"");
//TO:
SmartSetup(static_cast<char*>(World.c_str()), static_cast<char*>(",f5"), 765, 503, static_cast<char*>(""));
memcpy(&INH, (void*)((DWORD)Buffer + IDH.e_lfanew), sizeof(INH));
TO:
memcpy(&INH, static_cast<void*>(static_cast<DWORD>(Buffer) + IDH.e_lfanew), sizeof(INH));
std::function<void()> func = *((std::function<void()>*)lpParameter);
TO:
std::function<void()> func = *(static_cast<std::function<void()>*>(lpParameter));
I'm not sure when I should use re-interpret cast or if I'm abusing this type of cast I'm currently using. Should I leave everything as C-Style cast? How does it affect typedefs when importing from a DLL? How can I cast: (void*) &Meh
using C++?? I used a static cast to void*.