Electronic Circuits - Electronic Tutorials - Electronic Hobby Projects - A Complete Electronic Resource Centre

C Language Programming Library Reference Guide

Products

Sitemap

Online
Calculators

Circuits (A-C)

Circuits (D-O)

Circuits (P-Z)

Tutorials


 
Google
 
Web Hobbyprojects.com

Operators - Assignment

An assignment operator stores the value of the right expression into the left expression.
expression1 = expression2
The value of expression2 is stored in expression1.

expression1 *= expression2
The value of expression1 times expression2 is stored in expression1.

expression1 /= expression2
The value of expression1 divided by expression2 is stored in expression1.

expression1 %= expression2
The value of the remainder of expression1 divided by expression2 is stored in expression1.

expression1 += expression2
The value of expression1 plus expression2 is stored in expression1.

expression1 -= expression2
The value of expression1 minus expression2 is stored in expression1.

expression1 <<= shift_value
The value of expression1's bits are shifted to the left by shift_value and stored in expression1.

expression1 >>= shift_value
The value of expression1's bits are shifted to the right by shift_value and stored in expression1.

expression1 &= expression2
The value of the bitwise AND of expression1 and expression2 is stored in expression1.
 
e1 e2 Result
0 0 0
0 1 0
1 0 0
1 1 1

expression1 ^= expression2
The value of the bitwise XOR of expression1 and expression2 is stored in expression1.
 
e1 e2 Result
0 0 0
0 1 1
1 0 1
1 1 0

expression1 |= expression2
The value of the bitwise OR of expression1 and expression2 is stored in expression1.
 
e1 e2 Result
0 0 0
0 1 1
1 0 1
1 1 1
Search
Custom Search

<<<  Back to C Language Library Reference Guide

<<<  Back to Electronics Tutorials