Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Programming Fundamentals/Abbreviated Precedence Chart for C++ Operators

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

An abbreviated precedence chart for C++ operators typically used in a modular structured programming fundamentals course. An operator is a language-specific syntactical token (one or more symbols) that causes an action to be taken on one or more operands. The following item provides an abbreviated list of those C++ operators that are typically taught in a programming fundamentals course that teaches modular structured programming concepts. The first column shows the precedence (the higher precedence is 1 or it goes first) and operators that have the same precedence also have the same associativity (the associativity is only listed once for the group of operators). Decrement is two minus signs, but some word processing software programs might have problems printing two minus signs and convert it to a double dash. Insertion (two < signs) and extraction (two > signs) might also have printing problems. These printing problems are noted in the comments with emphasized text. +TABLE 1PROPERATOR NAMESYMBOL(S)COMMENTSASSOICIATIVITYCONNEXIONS MODULE1function call()Left to Rightm191451index[]aka array indexm213162class member.a periodRight to Leftm207962postfix increment ++unarym204992postfix decrement --unary, two minus signsm204993indirection*unary, aka dereferenceRight to Leftm221523address&unarym221483unary positive +unary, aka plusm205013unary negative -unary, aka minusm205013prefix increment ++unarym204993prefix decrement --unary, two minus signsm204993cast(type)unarym187443sizeofsizeof (type)unarym187363logical NOT!unarym198474multiply*Left to Rightm187064divide/m187064modulus%remainderm187065add +Left to Rightm187065subtract -m187066insertion<<writing, two less than signsLeft to Rightm188356extraction>>reading, two greater than signsm188357less than<Left to Rightm195497greater than>m195497less than or equal to<=m195497greater than or equal to>=m195498equality==equal toLeft to Rightm195498inequality!=not equal tom195499logical AND&&Left to Rightm1984710logical OR||Left to Rightm1984711conditional? :trinaryLeft to Rightm2081112assignment=Right to Leftm1872512addition assignment +=m1874312subtraction assignment -=m1874312multiplication assignment*=m1874312division assignment/=m1874312modulus assignment%=m1874313sequence or comma,Left to Rightm18690