Witam,
Mam takie pytanie, czy jest możliwe zadeklarowanie takiej struktury?
typedef struct Device_Parameters
{
int test1;
int test2;
...
unsigned char ttest;
void (*functrion)(unsigned int parameter, Device_Parameters* device);
} Device_Parameters;
Jak widać w strukturze znajduje się wskaźnik na funkcję, w której jednym z parametrów jest wskaźnik na tworzoną strukturę.
W chwili obecnej problem rozwiązałem pośrednio:
typedef struct Device_Parameters
{
int test1;
int test2;
...
unsigned char ttest;
void (*functrion)(unsigned int parameter, unsigned char* device);
} Device_Parameters;
i później w wywołaniu funkcji:
Device_Parameters Device;
...
Device.Function(tmp, (unsigned char*) &Device);
i samej funkcji:
void Function1(unsigned int mens, unsigned char* test)
{
Device_Parameters* device = (Device_Parameters*) test;
...
}
Może dałoby się to jakoś uprościć?
Dziękuję i pozdrawiam,
Hiob.