It depends on whether you want a pointer or not.
It is better to name your structure as follows:
Typedef struct s_data { int a; char *b; etc.. } t_data;
After creating it for a structure without a pointer:
t_data my_struct; my_struct.a = 8;
And if you want a pointer, you need to do this:
t_data *my_struct; my_struct = malloc(sizeof(t_data)); my_struct->a = 8
I hope this answer to your question
source share