Wikipedia refers to them as:
-> Member b of object pointed to by a
->* Member pointed to by b of object pointed to by a
.* Member pointed to by b of object a
But I need to refer to them without using "a" and "b". Do they have any names?
An Arrow operator in C/C++ allows to access elements in Structures and Unions. It is used with a pointer variable pointing to a structure or union. The arrow operator is formed by using a minus sign, followed by the greater than symbol as shown below.
The -> is called the arrow operator. It is formed by using the minus sign followed by a greater than sign. Simply saying: To access members of a structure, use the dot operator. To access members of a structure through a pointer, use the arrow operator.
The addition assignment operator ( += ) adds the value of the right operand to a variable and assigns the result to the variable. The types of the two operands determine the behavior of the addition assignment operator.
Pointers, Operator * The * operator is used when declaring pointer types but it is also used to get the variable pointed to by a pointer. Pointers are important data types due to special characteristics. They may be used to indicate a variable without actually creating a variable of that type.
The standard has calls ->*
and .*
"pointer-to-member operators" (5.5). The former expects the first operand to be of pointer type, the second of class type.
Similarly, ->
and .
are called "class member access" (5.2.5), or "dot" and "arrow".
If you're discussing them in conversation, I us the terms::
-> "Arrow" eg. "B-arrow-A"
->* "Arrow-star" eg. "B-arrow-star-A"
.* "Dot-star" eg. "B-dot-star-A"
When writing about them, I prefer the terms others have mentioned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With