What does that mean in C ++ 2
C ++ programming: operators
Gives a negative sign to a numeric value or reverses the sign.
Used to explicitly specify the sign. Since numbers without an explicit sign are always positive, this operator can be omitted. Sometimes useful to explicitly point out the sign.
Arithmetic operators 
The usual arithmetic conversions used to match the types and to determine the type of result.
+ (Addition) 
Adds the values of its operands and returns the result.
- (subtraction) 
Subtracts the values of its operands and returns the result.
* (Multiplication) 
Multiplies the values of its operands and returns the result.
/ (Division) 
Divides the values of its operands and returns the result. When dividing integers, any remainder is omitted, so it is not rounded.
% (Modulo) 
Divides the values of its operands and returns the remainder. Can only be applied to integer operands. If at least one operand is negative, the sign of the result depends on the implementation.
++ (increment) 
Increases the value of its operand by 1.
With regard to the priority, a distinction is made between postfix and prefix notation. The postfix notation (i ++) has a higher priority than the prefix notation (++ i).
- (Decrement) 
Decreases the value of its operand by 1.
With regard to the priority, a distinction is made between postfix and prefix notation. The postfix notation (i--) has a higher priority than the prefix notation (--i).
= (Assignment) 
Assigns the value of the right operand to its left operand.
Combined assignment operators 
The combined assignment operators combine the assignment operator (=) with another operator:
The left operand is used both as the left operand for the assignment and for the other operator.a + = b;
so meansa = a + (b);
The bracket around b is intended to make it clear that the entire right expression is calculated first.
== (equality) 
Returns the Boolean value true if the two operands are equal, otherwise false.
! = (Inequality) 
Returns the Boolean value true if the two operands are not equal, otherwise false.
<= (less than or equal to) 
Returns the Boolean value true if the left operand is less than or equal to the right operand, otherwise false.
> = (greater than or equal to) 
Returns the Boolean value true if the left operand is greater than or equal to the right operand, otherwise false.
Returns the Boolean value true if the left operand is smaller than the right one, otherwise false.
> (larger) 
Returns the Boolean value true if the left operand is greater than the right, otherwise false.
<=> (three-way comparison) 
Since C ++ 20: Returns an object that
- is less than 0 if the left operand is less than the right
- equals 0 if the left operand is the same as the right one
- is greater than 0 if the left operand is greater than the right
Propositional logic 
&& (AND link) 
Combines the two operands and returns true if both operands have the value true, otherwise false.true true ---- true
If the result can already be predicted after the first operand has been evaluated (i.e. if this is false, the result is certainly false), the second operand is no longer evaluated.
|| (Or link) 
Combines the two operands and returns true if at least one of the two operands has the value true, otherwise false.true false ---- true
If the result can already be predicted after the first operand has been evaluated (i.e., if this is true, the result is certainly true), the second operand is no longer evaluated.
! (Negation) 
Inverts the value of its operands. True becomes false and vice versa.true ---- false
Bit manipulation 
& (bitwise AND operation) 
Links each bit of both operands.1100 1010 ---- 1000
| (bitwise OR link) 
Combines every bit of both operands.1100 1010 ---- 1110
^ (exclusive OR link) 
Links each bit of both operands.1100 1010 ---- 0110
~ (bitwise negation) 
Negates the value of each bit.10 -- 01
<< (left shift) 
Shifts the bits of the left operand by the number of places specified by the right operand and fills the places on the right with zeros.int i = 1; // dual: 00000001 int n = i << 1; // dual: 00000010 = 2
>> (right shift) 
Shifts the bits of the left operand the number of places specified by the right operand to the right. The digits shifted to the right fall out, so to speak.int i = 5; // dual: 00000101 int n = i >> 1; // dual: 00000010 = 2 int a = -2; // dual: 11111110 int b = a >> 1; // dual: 11111111 = -1
Data access 
* (Pointer dereferencing) 
Dereferences a pointer so that the real content (the address) is not accessed, but the memory area to which it refers.int variable = 5; int * pointer = & variable; *pointer = 3; // changes the value of variable on 3
. (Access to members of an object) 
Accesses a member of an object.obj.member = value; obj.function ();
-> (access to members of an object via a pointer) 
Dereferences a pointer to an object specified by the left operand and accesses the member specified by the right operand.obj_pointer-> member = value; obj_pointer-> function ();
This is equivalent to the following notation:(* obj_pointer) .member = value; (* obj_pointer) .function ();
:: (qualification) 
Qualification of an identifier (variable, function, class) with its superordinate element (namespace, class).std :: cout << "Hello!" << std :: endl;
. * (Access to and simultaneous dereferencing of a member) 
Access and simultaneous dereferencing of a pointer member of an object.object. * pointer_member = 5;
-> * (access to and simultaneous dereferencing of a member via a pointer) 
Access and simultaneous dereferencing of a pointer member of an object pointerobj_zeiger -> * pointer_member = value;
Type conversion 
() (explicit casting) 
Converts the value of the expression to the right of the bracket to the type inside the bracket.
- Depending on the context, the compiler uses a const_cast, static_cast or reinterpret_cast (see below) to implement the instruction.
- This type of conversion comes from C and should be avoided if possible in C ++. Serious errors can occur if a static_cast is expected, but the compiler uses a reinterpret_cast out of the context.
- You cannot only cast from / to built-in data types.
- Constructor notation (only for built-in data types that are not multi-part):
- Numbers like 3.3 are doubles by default. But if you want to have a float, it is sufficient to write 3.3f.
Counterpart to C-Casting.
The target type is in the angle brackets. If you want to convert pointers to objects in a hierarchy, you should rather use dynamic_cast.
Enables write access to a constant declared variable.
Correct conversion of a pointer or a reference to an object of a base class to an object of a derived class. Dynamic_cast can only be used if the class has at least one virtual method. Usually the destructor is made virtual.
- This type of conversion only works if the object to be converted is really one of the target type.
- For the opposite direction, the conversion happens implicitly, dynamic_cast is not required.
- Danger: If the conversion of a pointer fails, dynamic_cast returns a null pointer (0)!
- Danger: If the conversion of a reference fails, dynamic_cast throws the exception std :: bad_cast!
Most dangerous and powerful cast that is rarely really needed.
Among other things, it can be used to "reinterpret" pointers in data types (and vice versa).
This example shows fp to a most likely undefined float variable at the memory address 25.
This operator can be used to query information about a variable, a reference, a (dereferenced) pointer or a class during runtime. The operator returns a reference of type type_info & that is in the header file type info is defined.
Danger: In order to be able to use this operator, RTTI must be activated explicitly in most compilers (in the GNU compiler for example with the command line option-frtti), since the introspection requires a lot of effort from the compiler.
Memory handling 
& (Address determination) 
Determines the address of the operand.
sizeof (storage requirement determination) 
Determines the memory requirements of a type or an expression.
Parentheses must be used for a type as an argument, but not for an expression.
new (object creation) 
Creates an object of the specified type. Returns a pointer to the new object.
new  (creating an object array) 
Creates an array of objects.
delete (object destruction) 
Destroys the specified object.
Requires a pointer to the object as an argument. The object must have been created with the new operator. Exception: The pointer can also be NULL.
delete  (destruction of an object array) 
Destroys the objects in the specified array.
The objects must have been created with the operator new .
() (Function call) 
Calling a function and possibly specifying parameters.
, (List) 
The comma has a double meaning in C ++.
On the one hand, it has the (purely syntactic) task of a separator in function calls and initializations:
On the other hand, it denotes the Sequential operator. The expressions separated by commas are left to right rated. For example
is used when the loop is reinitialized first and then run.
* Pointer declaration 
Creates a pointer to a specific data type.
?: (Condition) 
The conditional operator (incidentally the only ternary operator, i.e. an operator with three operands) is a shortened form of an if-else construct.
Results in the first operand (in this case a> b) true, the entire expression results in the second operand, otherwise the third. So the above line could be written as follows:
The operand that does not represent the result is not evaluated.
 (Indexing) 
Access to a specific element of an array.
: (Inheritance) 
Inheriting variables and functions of a class
: (Initialization) 
Initialization of superclasses and member variables within the constructor definition
Pointers should not, but may, be assigned new in the initialization. This leads to memory leaks.
It is better as follows:
throw (exception throwing) 
Throws the exception specified as an operand.throw exception;
- Why do sports photographers use Canon DSLRs
- What do more transistors mean
- What does Toncil do
- How do I sell valuable baseball cards
- Which is the best digital caliper
- How do you run a media company
- How useful is English
- How can we contact a heart specialist
- Why are transmission lines swapped
- How ugly is the human mind
- What foods increase body fat
- Has anyone really made money with Tsu
- Blondes have to bleach their hair
- Is the Vajirao helpful for IAS preparation?
- How is Netflix doing in India
- Capitalize on fascism
- Why is Robert Downey working with NASA
- What is the future of voice search
- What are aura readings
- How did the First World War affect France?
- How do you diagnose emphysema
- How fast is Superman's response time
- How do social media websites address Lurkers
- Neil Gaiman has a YouTube account