On Sat, 2006-09-09 at 17:34 +0200, mathieu lacage wrote:
> Another solution would be to do something like this:
>
> extern void *magic_function (void *variable_uid);
>
> static int a;
> void foo (void)
> {
> void *ptr = magic_function (&a);
> int *pa = (int *)ptr;
> *pa = 1;
> }
I think that the code above should be:
extern void *magic_function (void *variable_uid, int size);
static int a;
void foo (void)
{
void *ptr = magic_function (&a, sizeof (a));
int *pa = (int *)ptr;
*pa = 1;
}
Mathieu
