I am using a structure
typedef struct ObjectHandle
{
long *objHandle;
}ObjectHandle ;
A function where the output is the value of this structure
AllocateObject(ObjectHandle* objectHandle)
{
....
...
...
objectHandle->objHandle = some long value;
}
But compiler is giving warning: assignment makes pointer from integer without a cast
Please help
Seems like you're assigning the value not to the value (memory), but to a pointer (address)
Try this:
*(objectHandle->objHandle) = some long value;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With