binaryDigit
12-19-2002, 08:50 PM
storing user data with void *
user data will be of any type
char *, int, struct....
tried using sizeof() to malloc space for the void *, problem is char *'s have a size of 4 even when strlen is something like 20.
i either need to use something that will find the size of any data. char *, int , or struct...
or i need to be able to detect when a void * is pointing to a char *.
any ideas... ??
user data will be of any type
char *, int, struct....
tried using sizeof() to malloc space for the void *, problem is char *'s have a size of 4 even when strlen is something like 20.
i either need to use something that will find the size of any data. char *, int , or struct...
or i need to be able to detect when a void * is pointing to a char *.
any ideas... ??