answersLogoWhite

0

What is associatively of operator?

Updated: 9/20/2023
User Avatar

Wiki User

12y ago

Best Answer

In simple, For operators, associativity means that when the same operator appears in a row, then to which direction the evaluation binds to. In the following, let Q be the operator a Q b Q c

If Q is left associative, then it evaluates as (a Q b) Q c

And if it is right associative, then it evaluates as a Q (b Q c)

It's important, since it changes the meaning of an expression. Consider the division operator with integer arithmetic, which is left associative 4 / 2 / 3 <=> (4 / 2) / 3 <=> 2 / 3 = 0

If it were right associative, it would evaluate to an undefined expression, since you would divide by zero 4 / 2 / 3 <=> 4 / (2 / 3) <=> 4 / 0 = undefined

User Avatar

Cassandra Carroll

Lvl 10
1y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is associatively of operator?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are different types of operators?

The different types of operators are as follows: *Arithmatic operator *Relational operator *Logical operator *Assignment operator *Increment/Decrement operator *Conditional operator *Bitwise operator *Special operator


What is the operator that cannot be overloaded in c plus plus and java?

conditional operator , size of operator , membership operator and scope resulation operator can not be overload in c++


Which operator works like sizeof operator in Java?

Java does not have the sizeOf() operator or any operator that gives an equivalent result.


Is a water operator or an water operator which is correct?

A water operator is grammatically correct.


What is operator function?

An operator function implements a particular operator symbol. The database server provides special SQL-invoked functions, called operator functions, that implement operators. An operator function processes one to three arguments and returns a value. When an SQL statement contains an operator, the database server automatically invokes the associated operator function. The association between an operator and an operator function is called operator binding. You can overload an operator function to provide the operator for a UDT. The SQL user can then use the operator with the UDT as well as with the built-in data types. When an SQL statement contains an operator, the database server automatically invokes the associated operator function.


How can you differentiate overloading of pre-fix and post-fix increment operator?

The prefix increment operator is overloaded as operator++() while the postfix increment operator is overloaded as operator++(int).


A water operator or an water operator?

A


Which c plus plus operators cannot be overloaded?

1. Member-of operator (.) 2. Pointer-to-member-of operator (.*) 3. Ternary condition operator (?:) 4. Scope resolution operator (::) 5. sizeof operator 6. typeid operator


Different types of tour operators?

domestic tour operator incoming tour operator outbound tour operator speacialist tour operator


The definition of a boolean operator?

what is boolean operator


What are the duties of operator?

retail operator responsobilities


What is a sentence using the word operator?

The suave and sophisticated deep cover spy was known as a smooth operator. One type of heavy equipment operator drives a bulldozer. The sewing machine operator will fix your snag.