Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the correct term for ->,->* and .* operators?

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?

like image 724
Pubby Avatar asked Sep 25 '11 23:09

Pubby


People also ask

What is -> operator called in C?

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.

What is the name of -> operator in C++?

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.

What is the name of this 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.

What is the * operator in C++ pointer?

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.


2 Answers

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".

like image 136
Kerrek SB Avatar answered Sep 28 '22 11:09

Kerrek SB


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.

like image 22
abelenky Avatar answered Sep 28 '22 12:09

abelenky