Is it possible to declare a variable implicitly in an initialization? Perhaps like so:
struct S
{
void *a;
void *b;
};
struct S test = {&(int), &(float) };
void testfunc (void)
{
*(test.a) = -2;
*(test.b) = 1.3;
}
Advantages (in my eyes):
- No additional lines needed for explicit declaration
- Implicit variables are protected in the struct, no external access.
void*without casting.