I'm trying to understand what the typecasting is doing in the following code
UA_Variant Variant;
Int32_t Variable;
variable = *(int32_t *) Variant.data;
printf("%d", variable);
This is the structure of the UA_Variant
typedef struct
{
const UA_DataType *type; /* The data type description */
UA_VariantStorageType storageType;
size_t arrayLength; /* The number of elements in the data array */
void *data; /* Points to the scalar or array data */
size_t arrayDimensionsSize; /* The number of dimensions */
UA_UInt32 *arrayDimensions; /* The length of each dimension */
} UA_Variant;
What is happening in this line
variable = *(int32_t *) Variant.data;
is it type casting the data in Variant to int32_t then taking the pointer of that into the variable and if so why can I print out the value stored in variable?