It depends on how the struct is declared. If we have an actual struct variable, use .
. If we have a pointer to a struct, use ->
:
struct my_struct *s = ...;
s->x = 5;
printf("%d\n", s->x);
struct my_struct s2 = ...;
s2.x = 4;
printf("%d\n", s2.x);