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/cast.html | 75 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 reference/C/CONCEPT/cast.html (limited to 'reference/C/CONCEPT/cast.html') diff --git a/reference/C/CONCEPT/cast.html b/reference/C/CONCEPT/cast.html new file mode 100644 index 0000000..6535052 --- /dev/null +++ b/reference/C/CONCEPT/cast.html @@ -0,0 +1,75 @@ + +cast + + +
+
+

To cast, casting

+
+
+ +If you want to change the +datatype of a variable +you have to use a technic called cast. For example if want to +change an int to a +float +you could use the following syntax: +

+

+ + + + +
+
+        
+    main()
+    {
+        int var1;
+        float var2;
+
+        var2 = (float)var1;
+    }
+
+
+
+

+As it happens this example would never be used in practice because C +would perform the conversion automatically. + +What this example does show is the cast operator () . This states, +the result of the expression (in this case var1) is to be a +data type of float. +

+


+

See Also:

+ + C++ changes to cast. +

+


+

+

+ + + + +
+Top + +Master Index + +Keywords + +Functions +
+
+

+ +


+
Martin Leslie + +
-- cgit v1.2.3-54-g00ecf