From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/C/CONCEPT/true_false.html | 78 +++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 reference/C/CONCEPT/true_false.html (limited to 'reference/C/CONCEPT/true_false.html') diff --git a/reference/C/CONCEPT/true_false.html b/reference/C/CONCEPT/true_false.html new file mode 100644 index 0000000..db7f90e --- /dev/null +++ b/reference/C/CONCEPT/true_false.html @@ -0,0 +1,78 @@ +True or False + +
+
+

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 + + + -- cgit v1.2.3-54-g00ecf