operator precedence in c 2b 2b

Solutions on MaxInterview for operator precedence in c 2b 2b by the best coders in the world

showing results for - "operator precedence in c 2b 2b"
Camilla
27 Feb 2016
1Operator Precendence in C++
2-----------------------------------------------------------------------------------------------
3Precedence   Operator	                        Description	              Associativity    
4-----------------------------------------------------------------------------------------------
5 1           ::                                 scope Resolution          Left to right        
6-----------------------------------------------------------------------------------------------
7 2           a++ a--                            Postfix incre/decre       Left to right         
8             type() type{}                      Functioncal cast                    
9             a()                                function call                     
10             []                                 subscript                         
11             -> .                               Member Access                     
12-----------------------------------------------------------------------------------------------
13 3           ++a --a                            Prefix incre/decre        Right to left
14             + -                                Unary	                           
15             ! ~                                Logical NOT,bitwise NOT            
16             (type)*                            C-style typecast                      
17               &                                Address of                        
18             sizeof                             size-of                                       
19             co_await                           await expression                       
20             new new[]                          Dynamic memory allocation                                  
21             delete delete[]                    Dynamic memory De-allocation                                             
22-----------------------------------------------------------------------------------------------
23 4            . * ->*                           pointer to member         Left to right 
24 5            * / %	                            Multiplicative	                 
25 6            + -	                            Additive	                       
26 7            << >>	                            Shift	                         
27 8            <=>                               Three way comparsion                            
28 9            < <= > >=	                        Relational	                     
29 10           == !=	                            Equality	                     
30 11           &	                                Bitwise AND     	             
31 12           ^                                 Bitwise XOR     	               
32 13           |	                                Bitwise OR	              
33 14           &&	                            Logical AND	              
34 15           ||	                            Logical OR	               
35----------------------------------------------------------------------------------------------
36 16           ?:	                            Conditional	              Right to left
37              throw                             Throw Operator
38              co_yield                          yield Expression
39                 =                              Assignment
40              += -= *= /= %=>>= <<= &= ^= |=    Compound Assignment	
41 ---------------------------------------------------------------------------------------------      
42 17            ,	                            Comma	                  Left to right
43----------------------------------------------------------------------------------------------