Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Augmented assignment
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==By language== ===C descendants=== In [[C (programming language)|C]], [[C++]], and [[C_Sharp_(programming_language)|C#]], the assignment operator is <code>=</code>, which is augmented as follows: {| class="wikitable" |- ! Operator ! Description |- ! <code>+=</code> | Addition |- ! <code>-=</code> | Subtraction |- ! <code>*=</code> | Multiplication |- ! <code>/=</code> | Division |- ! <code>%=</code> | Modulus |- ! <code><<=</code> | [[Bitwise operations in C#Left shift <<|Left bit shift]] |- ! <code>>>=</code> | [[Bitwise operations in C#Right shift >>|Right bit shift]] |- ! <code>&=</code> | [[Bitwise operations in C#Bitwise AND_&|Bitwise AND]] |- ! <code>^=</code> | [[Bitwise operations in C#Bitwise XOR ^|Bitwise exclusive OR]] |- ! <code>{{pipe}}=</code> | [[Bitwise operations in C#Bitwise OR {{pipe}}|Bitwise inclusive OR]] |} Each of these is called a ''compound assignment'' operator in said languages.<ref name="cppreference" /><ref>{{cite web|title=ISO/IEC 9899:201x Committee Draft April 12, 2011 N1570|url=http://www.iso-9899.info/n1570.html#6.5.16.2}}</ref><ref>{{cite web|title=Assignment and compound assignment operators|url=http://eel.is/c++draft/expr.ass}}</ref><ref>{{cite web|title=C# Language Specification|url=http://msdn.microsoft.com/en-us/library/ms228593.aspx|publisher=Microsoft|accessdate=17 March 2014}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)