I did try searching for this on Stack Overflow, but I think due to the syntax and not knowing exactly what to search I became a little unstuck.
I have seen (v
That is mostly used when you want to pass a parameter that can have different states.
For example, in your generic code you would pass the void*
as a parameter, and then in the "specific" implementation of that code, you would cast the void*
to whatever you want
Generic code, abc.h
void Test(void* pHandle);
Windows code, abc.cpp
void Test(void* phandle)
{
WindowsStructure* myStruct = (WindowsStructure*)(pHandle);
myStruct->getWhatINeed;
}
Linux code, abc.cpp
void Test(void* phandle)
{
LinuxStructure* myStruct = (LinuxStructure*)(pHandle);
myStruct->getWhatINeed;
}