I was wondering if it is possible in C to initialise a structure in a following way:
struct Test* test = { .int_value = 10, .char_value = 'c', .pointer_to_float_value = (float*)1.512 };
If I try to do this with a structure defined in a way:
struct Test
{
int int_value;
char char_value;
float* pointer_to_float_value;
};
I get an error for all elements of the structure:
error: field name not in record or union initializer
Is there a way to bypass this issue?