Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

The GNU C Programming Tutorial - Important note about assignment

Node:Important note about assignment, Previous:The assignment operator, Up:The assignment operator



Important note about assignment

Many people confuse the assignment operator (=) with the equality operator (==), and this is a major source of bugs in C programs. Because of early arithmetic training, people tend to think of = as indicating equality, but in C it means "takes on the value produced by", and it should always be read that way. By way of contrast, == is an equality test operator and should always be read "is tested for equality with". (See Comparisons and logic, for more information on the == operator.)

 
 
  Published under free license. Design by Interspire