summaryrefslogtreecommitdiff
path: root/reference/CPLUSPLUS/SYNTAX/const.html
blob: 8c28d353bf7ead8a7b12c4fdba7f04c6561f4f5c (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
<title>const keyword</title>

<head>
<script language="JavaScript" src="../../JAVASCRIPT/standard.js">
</script>
</head>

<body bgcolor="#dddddd">
<font color=brown>
<hr>
<center><h1>const keyword</h1></center>
<hr>
<p>
In the C++ world, the use of <b>const</b> is considered to be an 
improvement over <a href=../../C/SYNTAX/preprocessors.html>#define</a>
in general the usual 
<a href="../../C/SYNTAX/const.html">C programming rules</a> apply.
There is one exception within a class, this is because the class syntax
does not allow the assignment of a variable when it is declared. The result
is a rather strange looking syntax. Please see the example below.
<p>
 
<hr>
<h2>Examples:</h2>
<img src="../../GRAPHICS/computer.gif" alt="o">
<a href="../EXAMPLES/const1.cc">Example program.</a>
<hr>
<h2>See Also:</h2>
<hr>

</font>
<font color=black>
<h2>C References</h2>
<img src="../../GRAPHICS/whiteball.gif" alt="o">
<a href="../../C/SYNTAX/const.html">C version of const.</a>
<br>
<img src="../../GRAPHICS/whiteball.gif" alt="o">
<a href="../../C/CONCEPT/constants.html">Theory of constants.</a>
<p>

<script> 
tail("27-Sep-98");
</script>