summaryrefslogtreecommitdiff
path: root/reference/CPLUSPLUS/CONCEPT/cast.html
blob: cc2df6e44a3bb089f5a19d52ca797cb3c2412475 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<html>
<head>
<title>C++ casting</title>
</head>
<body bgcolor="#dddddd">
<font color=brown>
<hr>
<center><h1>C++ casting.</h1></center>
<hr>
<p>

C++ has added a new feature to  
<A HREF="../../C/CONCEPT/cast.html">cast</a>
that allows you to cast variables by using a slightly 
more familuar syntax. Have a look at the example below.

<p>
<center>
<table border=1 width="80%" bgcolor="ivory">
<tr>
<td>
<pre>
        
    main()
    {
        int var1;
        float var2;

        var2 = float(var1);
    }
</pre>
</td>
</tr>
</table>
</center>
<p>
The example shows that casting can now look like a function call.
<p> 
<hr>
<h2>Examples:</h2>

<font color=brown>
<img src="../../GRAPHICS/computer.gif" alt="o">
<a href="../../CPLUSPLUS/EXAMPLES/cast.cc">C++ Example program.</a>
</font>

<hr>
<h2>See Also:</h2>

</font>
<hr>
<font color=black>
<h2>C References</h2>
<p>
<img src="../../GRAPHICS/whiteball.gif" alt="o">
<a href="../../C/CONCEPT/cast.html">C casting</a>.

</font>

<hr>
<p>
<center>
<table border=2 width="80%" bgcolor="ivory">
<tr align=center>
<td width="25%">
<a href="../cref.html">Top</a>
</td><td width="25%">
<a href="../../C/master_index.html">Master Index</a>
</td><td width="25%">
<a href="../SYNTAX/keywords.html">Keywords</a>
</td><td width="25%">
<a href="../../C/FUNCTIONS/funcref.htm">Functions</a>
</td>
</tr>
</table>
</center>
<p>
<hr>
<font color=brown>
<address>Martin Leslie 
<script language="JavaScript">
<!--  //
document.write(document.lastModified);
// -->
</script>
</address><p>
</font>
</body>
</html>