Fabbri Systems Forum Index Fabbri Systems
Fabbri Systems Technical Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

C Operator Precedence

 
Post new topic   Reply to topic    Fabbri Systems Forum Index -> C Tips and Tricks

 

 

 

 

View previous topic :: View next topic  
Author Message
admin
Site Admin


Joined: 28 Feb 2006
Posts: 24

PostPosted: Tue Jul 18, 2006 6:40 pm    Post subject: C Operator Precedence Reply with quote

In case you haven't memorized all of these yet, here is a table of operator precedence in C. Also listed is the associativity, which basically dictates the order in which operands are evaluated for binary expressions.

If you are on a FreeBSD or Linux system, you can simply type "man operator" to pull up a man page with this information.

Code:

OPERATOR(7)                           BSD Miscellaneous Information Manual                           OPERATOR(7)

NAME
     C operator - C operator precedence and order of evaluation

DESCRIP= += -= *= /= %= <<= >>= &= ^= |=    right to left
           ,TION
     This manual page lists C operators and their precedence in evaluation.

           Operator                             Associativity
           --------                             -------------
           () [] -> .                           left to right
           ! ~ ++ -- - (type) * & sizeof        right to left
           * / %                                left to right
           + -                                  left to right
           << >>                                left to right
           < <= > >=                            left to right
           == !=                                left to right
           &                                    left to right
           ^                                    left to right
           |                                    left to right
           &&                                   left to right
           ||                                   left to right
           ?:                                   right to left
                                               left to right

BSD                                              August 24, 2003                                             BSD
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Fabbri Systems Forum Index -> C Tips and Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group