Lets say I have this struct:
typedef struct nKey {
int num;
widget* widget;
} NUMBER_KEY;
and a function:
void dialKey(widget* widget) {
// Need to print 'num' of the struct that this widget resides in
}
How do I go about accomplishing this? I tried something like:
printf("%d", * (int *) widget - sizeof(int)); // Failure.org
edit: it is safe to assume that the widget being passed is in fact a member of a NUMBER_KEY struct
edit: looking for a solution to the problem not another method.