My reading of the docs indicate that event.packet-data is a enet_uint8 *, which is typecast from a pointer to char. This implies that I should be able to cast it to void*
Yup, any pointer type can be cast to void*.

void    *buffer;

buffer = (void) event.packet->data;

But this didn't seem to work. Like I said, I'm a bit rusty... So I was on the right track? I just have to fiddle with syntax, then.
That should be buffer = (void*)event.packet->data; as you want a pointer.
You don't even have to cast explicitely as void* is a "more general" type than uint8* so buffer=event.packet->data; will work as well. Explicit cast is only needed with pointers when the destination type is "more specific" than the original type, e.g. struct SomeStruct *structPtr = (struct SomeStruct*)buffer;

Regards,

--
Emmanuel

<<attachment: emmanuel_raulo.vcf>>

_______________________________________________
ENet-discuss mailing list
[email protected]
http://lists.cubik.org/mailman/listinfo/enet-discuss

Reply via email to