True or False.


The concept of an expression evaluating to true or false is one of the corner stones of C. BUT the language derives true and false in an unusual way.

Basicly there is no boolean value. The number 0 is considered to be false and all other numbers are considered to be true....

Please consider the following expressions.

	(1 == 1) 	true
	(1 != 1)	false
	(i  = 1)   	true
	(i  = 0)   	false
	(i  = 1 + 1) 	true
The first two examples should be clear but the last ones need explanation .

The last three examples assign a value to a variable and a side effect of assignment is to return the value assigned, it is this value that is tested to be true or false.

Looking at the last example:

	(i = 1 + 1)
  	(i = 2)
	(2)


See Also:

enum keyword

Top Master Index Keywords Functions


Martin Leslie
Corrections made by Christopher Wolf t.git/tree/include/dt-bindings/reset/sun8i-h3-ccu.h?h=nds-private-remove&id=cceb0a5973202b4a5d649ede937d35786d7ca168'>treecommitdiff
path: root/include/dt-bindings/reset/sun8i-h3-ccu.h
AgeCommit message (Expand)AuthorFilesLines