| C Tutorial | Assignment operator | |||
|
Introduction to C language Integer types Char constants Int constants Type combination and promotion Int overflow Floating point types Comments Variables Assignment operator Truncation Int vs float arithmatic Mathematical operators Unary Increment Operators Pre and Post Variations C Programming Cleverness and Ego Issues Relational Operators Logical Operators Bitwise Operators Other Assignment Operators
|
The assignment operator is the single equals sign (=).
i = 6; i = i + 1;
The assignment operator copies the value from its right hand side to the variable on its left hand side. The assignment also acts as an expression which returns the newly assigned value. Some programmers will use that feature to write things like the following.
y = (x = 2 * x); // double x, and also put x's new value in y Want more information and Video ???
|
|