I am trying to cast data to a struct from a parameter passed into my method, I need the data to be passed to a global variable as it is needed elsewhere in my application.
I have tried the following but I get errors saying that diceResult
is an undeclared identifier
Here is the code itself:
//Structure to hold dice data
typedef struct diceData
{
int dice1;
int dice2;
};
struct diceResult;
DWORD WINAPI UnpackDiceData(LPVOID sentData)
{
//Unpack data
struct diceData unpackedData = *((struct diceData*)sentData);
diceResult.dice1 = unpackedData.dice1;
diceResult.dice2 = unpackedData.dice2;
}
I don't understand why it won't recognise it being there when it's clearly global.