Member access operators
From cppreference.com
Member access operators allow access to the members of their operands.
Operator | Operator name | Example | Description |
---|---|---|---|
[] | array subscript | a[b] | access the bth element of array a |
* | pointer dereference | *a | dereference the pointer a to access the data it points to |
& | address of | &a | the address of a |
. | struct member | a.b | access member b of struct a |
-> | struct member of pointer to struct | a->b | access member b of struct pointed to by a
equivalent of first dereferencing the pointer to the struct a then accessing member b: (*a).b |
[edit] See Also
- Operator precedence
- Arrays
- Pointers
- Keyword: struct
Common operators | ||||||
---|---|---|---|---|---|---|
assignment | increment decrement |
arithmetic | logical | comparison | member access |
other |
a = b |
++a |
+a |
!a |
a == b |
a[b] |
a(...) |