Search
 
SCRIPT & CODE EXAMPLE
 

CPP

operator precedence in cpp

Operator Precendence in C++
-----------------------------------------------------------------------------------------------
Precedence   Operator	                        Description	              Associativity    
-----------------------------------------------------------------------------------------------
 1           ::                                 scope Resolution          Left to right        
-----------------------------------------------------------------------------------------------
 2           a++ a--                            Postfix incre/decre       Left to right         
             type() type{}                      Functioncal cast                    
             a()                                function call                     
             []                                 subscript                         
             -> .                               Member Access                     
-----------------------------------------------------------------------------------------------
 3           ++a --a                            Prefix incre/decre        Right to left
             + -                                Unary	                           
             ! ~                                Logical NOT,bitwise NOT            
             (type)*                            C-style typecast                      
               &                                Address of                        
             sizeof                             size-of                                       
             co_await                           await expression                       
             new new[]                          Dynamic memory allocation                                  
             delete delete[]                    Dynamic memory De-allocation                                             
-----------------------------------------------------------------------------------------------
 4            . * ->*                           pointer to member         Left to right 
 5            * / %	                            Multiplicative	                 
 6            + -	                            Additive	                       
 7            << >>	                            Shift	                         
 8            <=>                               Three way comparsion                            
 9            < <= > >=	                        Relational	                     
 10           == !=	                            Equality	                     
 11           &	                                Bitwise AND     	             
 12           ^                                 Bitwise XOR     	               
 13           |	                                Bitwise OR	              
 14           &&	                            Logical AND	              
 15           ||	                            Logical OR	               
----------------------------------------------------------------------------------------------
 16           ?:	                            Conditional	              Right to left
              throw                             Throw Operator
              co_yield                          yield Expression
                 =                              Assignment
              += -= *= /= %=>>= <<= &= ^= |=    Compound Assignment	
 ---------------------------------------------------------------------------------------------      
 17            ,	                            Comma	                  Left to right
------------------------------------------------------------------------------
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to get euler constant in c++ 
Cpp :: find text in string c++ true false 
Cpp :: convert ascii char value to hexadecimal c++ 
Cpp :: c++ namespace example 
Cpp :: C++ program for Celsius to Fahrenheit and Fahrenheit to Celsius conversion using class 
Cpp :: print Colored text in C++ 
Cpp :: C++ linked list iterator 
Cpp :: c++ convert int to cstring 
Cpp :: z transfrom mathlab 
Cpp :: how to declare a 2d vector stack 
Cpp :: c++ json parser euc-kr 
Cpp :: remove comments c++ 
Cpp :: Euler constant 
Cpp :: how to print a word in c++ 
Cpp :: log base e synthax c++ 
Cpp :: std::map get all keys 
Cpp :: len in cpp 
Cpp :: c++ if else example 
Cpp :: ternary operator in c++ 
Cpp :: transpose matrix c++ vectors 
Cpp :: valid parentheses in cpp 
Cpp :: not c++ 
Cpp :: gcd in cpp 
Cpp :: 83. remove duplicates from sorted list solution in c++ 
Cpp :: Round 1 Confusion codechef solution in c++ 
Cpp :: c++ throw index out of bound 
Cpp :: even number program in c++ using for loop stack overflow 
Cpp :: c++ error missing terminating character 
Cpp :: initalising array c++ 
Cpp :: sort an array using stl 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =