summaryrefslogtreecommitdiff
path: root/reference/CPLUSPLUS/SYNTAX/struct.html
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2008-01-27 11:37:44 +0100
committerTobias Klauser <tklauser@xenon.tklauser.home>2008-01-27 11:37:44 +0100
commit7e0f021a9aec35fd8e6725e87e3313b101d26f5e (patch)
treeb1cacc4b24393f517aeb4610e9e1021f954307a8 /reference/CPLUSPLUS/SYNTAX/struct.html
Initial import (2.0.2-6)2.0.2-6
Diffstat (limited to 'reference/CPLUSPLUS/SYNTAX/struct.html')
-rw-r--r--reference/CPLUSPLUS/SYNTAX/struct.html102
1 files changed, 102 insertions, 0 deletions
diff --git a/reference/CPLUSPLUS/SYNTAX/struct.html b/reference/CPLUSPLUS/SYNTAX/struct.html
new file mode 100644
index 0000000..57df58a
--- /dev/null
+++ b/reference/CPLUSPLUS/SYNTAX/struct.html
@@ -0,0 +1,102 @@
+<html>
+<head>
+<title>STRUCT keyword</title>
+</head>
+
+<body>
+<font color=brown>
+<hr>
+<h1>
+<center>struct keyword in C++</center>
+</h1>
+<hr>
+
+<p>
+The <b>struct</b> keyword was introduced in 'C', its original functionality
+is documented
+<a href=../../C/SYNTAX/struct.html>here.</a>
+<p>
+
+C++ has added two new features to structures.
+<ol>
+<li>The syntax has been improved slightly so you no longer have to
+ mess around with <a href=../../C/SYNTAX/typedef.html>typedef</a> statements.
+
+ <p>
+ <center>
+ <table border=1 width="80%" bgcolor="ivory">
+ <tr><td align=center>
+ <h3>ANSI C approch to structures.</h3>
+ </tr></td>
+ <tr><td>
+ <pre>
+
+ typedef struct Person {int age; char *name} Person_t;
+
+ struct Person FirstMan;
+ Person_t SecondMan;
+ </pre>
+ </td></tr></table>
+ <p>
+
+ <p>
+ <table border=1 width="80%" bgcolor="ivory">
+ <tr><td align=center>
+ <h3>C++ structures.</h3>
+ </tr></td>
+ <tr><td>
+ <pre>
+
+ struct Person {int age; char *name};
+
+ Person FirstMan;
+ Person SecondMan;
+ </pre>
+ </td></tr></table>
+ </center>
+ <p>
+
+<li>C++ also took the original idea of structures and added the ability to
+ associate functions with the data within the structure. This feature
+ was wrapped up with the introduction of the
+ <a href="class.html">class</a> keyword.
+</ol>
+<p>
+<hr>
+<h2>Examples:</h2>
+<img src="../../GRAPHICS/computer.gif">
+<a href="../EXAMPLES/struct1.cc">Example program.</a>
+<p>
+<hr>
+<h2>See Also:</h2>
+<img src="../../GRAPHICS/whiteball.gif" alt="o">
+<a href="keywords.html">C++ Keywords</a>
+<br>
+<img src="../../GRAPHICS/whiteball.gif" alt="o">
+<a href="../../C/SYNTAX/keywords.html">C Keywords</a>
+<p>
+
+<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="keywords.html"> C++ Keywords</a>
+</td><td width="25%">
+<a href="../../C/FUNCTIONS/funcref.htm"> Functions</a>
+</td>
+</tr>
+</table>
+</center>
+<p>
+<hr>
+<address>Martin Leslie
+12 Nov 98</address><p>
+</font>
+</body>
+</html>