Hello,
I would like to pass a parameter to a function variable can be of different type. I thought C was the generic type void *?
Simply put, a small example:
But it does not compile, is this a compile version problem?Code:# <stdio.h> void display (void* to, void* z) ( *x = 42; *z = *x * 0.1; printf("% s\ n% ft\ n", *x, *z); ) void hand (void) ( struct str ( int temp, float ft; ) struct str s, s.temp = 0; s.ft = 0.0; printf("% s\ n% ft\ n", s.temp, s.ft) displays (&s.temp, &s.ft); )
Bookmarks