Skip to content

Expressions

bilalkhld edited this page Mar 18, 2022 · 1 revision
Expression Example
Assignment lvalue = rvalue;
Function Call func(arg);
Math Operations (+,-, *, /, %, **) c = -(a + b);
Bitwise Operations (~, &, |, ^, <<, >>) c = ~(a | b);
Logical Operations (not, and, or, xor) if( a and b or not c) logic operators can be written as symbols as well, i.e., || for or, && for and, ^^ for xor, and ! for not.
Comparison(==, !=, >, <, >=, < =, is, !is) a == b, a > b, a is null
Increment and conditional Data Types i++, --I, choose ? a : b;
Op void, bool, int, double, string and array
Keywords and, auto, in, out, not, inout, or, is, xor and all predefined keywords of C++ are also not allowed.
Scope resolution operator int value; // local variable overloads the global variable ::value = value; // use scope resolution operator to refer to the global variable
Indexing operator arr[i] = 1;
Clone this wiki locally