answersLogoWhite

0


Best Answer

unary operators like ++,--

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What operators work differently when placed before rather than after an operand?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Why there is only 2 plus in c plus plus languagewhy not 3 or 4 plus?

I assume by 2 plus you really mean ++. This is the increment operator which is used to increment the operand. If placed before the operand, the operator evaluates the incremented operand (prefix increment). If placed after the operand, the operator evaluates the non-incremented operand (postfix increment). +++ and ++++ are meaningless but are assumed to mean incrementing an increment. If you wish to increment an increment, you must use the compound expression ++(++) or (++)++. Thus for the variable x, prefix incrementing twice would be achieved with ++(++x), while postfix incrementing twice would be achieved with (x++)++. You can also mix the two, such as ++(x++) or (++x)++, both of which would increment x twice but would evaluate the increment of x. If postfix increment is not a requirement, it would be much easier to use the compound expression x+=n, where n is the amount you wish to increment. This is the same as saying x=x+n.


Where be the surge arrester be placed?

Before the object on the positive and after on negetive


Do you have to open a new HTML document to edit a hyperlink?

No, we can edit the hyperlink in the same document. <a> tag can be placed after or before any tag.


What did a heater boy do?

the heater boy heated the rivets until they reached a certain colour before passing them to the catcher who then placed them for the rivetter to finish


Why you write c plus plus not plus plus c?

C++ uses the postfix increment operator whereas ++C uses the prefix increment operator. Both do exactly the same thing; they increment C (the same as C=C+1 increments C). The difference is only in the return value. ++C returns a reference to C, whereas C++ returns the original value of C.

Related questions

Why there is only 2 plus in c plus plus languagewhy not 3 or 4 plus?

I assume by 2 plus you really mean ++. This is the increment operator which is used to increment the operand. If placed before the operand, the operator evaluates the incremented operand (prefix increment). If placed after the operand, the operator evaluates the non-incremented operand (postfix increment). +++ and ++++ are meaningless but are assumed to mean incrementing an increment. If you wish to increment an increment, you must use the compound expression ++(++) or (++)++. Thus for the variable x, prefix incrementing twice would be achieved with ++(++x), while postfix incrementing twice would be achieved with (x++)++. You can also mix the two, such as ++(x++) or (++x)++, both of which would increment x twice but would evaluate the increment of x. If postfix increment is not a requirement, it would be much easier to use the compound expression x+=n, where n is the amount you wish to increment. This is the same as saying x=x+n.


An accent placed over a vowel to indicate that it is of short duration or pronounced differently?

Breve


How will a plant cell respond differently than a animal cell?

It will not burst when placed in a dilute solution.


Is dirt placed on MLB baseballs before a game?

Absolutely not. A ball that gets dirt on it is unusable because the dirt affects the shape of the ball, which can make it fly differently when pitched. This is also why pitchers aren't allowed to put any foreign substance, such as Vaseline, on the ball before pitching.


What is the difference between register addressing mode and register indirect addressing mode?

Ans: In the register addressing mode the operands are in registers which reside within the CPU. Register-mode instructions are 1-byte instructions and can be executed within the CPU without the need to reference memory for operands. But in the Register-indirect addressing mode the instruction specifies a register or a pair of registers in the processor whose contains give the address of the operand in memory. This mode uses 1-byte instructions even though the operand is in memory. Before using a register-indirect mode instruction, the programmer must ensure that the address of the operand is placed in the processor register with a previous transfer-type instruction. A reference to the register is then equivalent to specifying a memory address.


Adjectives are usually placed?

before the noun they describe


Where can the declaration of a function be placed?

The declaration of a function can be placed at, or anywere before its definition. It also needs to be placed prior to its first use.


Why does lipids have to be placed in alcohol first before being placed water?

it has to be placed in alcohol first because lipids are soluble in alcohol but not in water.


What is the preposition of mum placed the drinks on the tray before carrying them upstairs?

before


What is the final item placed on wet mount before viewing with a light?

The cover slip is the last item to be placed on a wet mount slide before viewing.


Where Gandhis ashes were placed before immersion?

kanyakumari


Should comma be before but or after?

In a compound sentence, the comma would be placed before the word but.