The ->
operator is only syntactical sugar:
x->y
is the same as
(*x).y
The parentheses are necessary due to the .
operator having higher precedence than the *
operator.
More Related Contents:
- What does the ??!??! operator do in C?
- What does the comma operator , do?
- Struct memory layout in C
- Difference between a Structure and a Union
- What is short-circuit evaluation in C?
- Pointer to pointer of structs indexing out of bounds(?) when I try to index anything other than zero
- How do I check if a variable is of a certain type (compare two types) in C?
- !! c operator, is a two NOT?
- What does i = (i, ++i, 1) + 1; do?
- Assign one struct to another in C
- The initialization of static variables in C
- Why doesn’t GCC optimize structs?
- How to initialize const in a struct in C (with malloc)
- C Typedef and Struct Question
- Writing a ‘generic’ struct-print method in C
- Trouble Understanding MPI_Type_create_struct
- How does a C-style struct with a bitfield get represented in a Rust #[repr(C)] struct?
- Can we have a struct element of type Variable length array? [duplicate]
- Empty structure in C
- Array of variable length in a structure
- forward declaration of a struct in C?
- Is there any way to loop through a struct with elements of different types in C?
- Access struct members as if they are a single array?
- Flexible array member not getting copied when I make a shallow copy of a struct
- size of struct in C [duplicate]
- Does GCC’s __attribute__((__packed__)) retain the original ordering?
- C initialize array within structure
- offsetof at compile time
- Iterating over same type struct members in C
- How can I malloc a struct array inside a function? Code works otherwise