summaryrefslogtreecommitdiff
path: root/reference/C/SYNTAX/comments.html
diff options
context:
space:
mode:
Diffstat (limited to 'reference/C/SYNTAX/comments.html')
-rw-r--r--reference/C/SYNTAX/comments.html111
1 files changed, 111 insertions, 0 deletions
diff --git a/reference/C/SYNTAX/comments.html b/reference/C/SYNTAX/comments.html
new file mode 100644
index 0000000..d3ff791
--- /dev/null
+++ b/reference/C/SYNTAX/comments.html
@@ -0,0 +1,111 @@
+<head>
+<title>Comments.</title>
+<script language="JavaScript">
+</script>
+</head>
+
+<body bgcolor="#ffffcc">
+<hr>
+<center>
+<h1>Comments.</h1>
+</center>
+<hr>
+<p>
+Lets start with a few examples.
+<p>
+<center>
+<table border=2 width="80%" bgcolor=ivory>
+<tr>
+<td>
+<pre>
+
+ main()
+ {
+
+ int Counter=0; /* Initalise Counter */
+
+ /* a comment */
+
+ /*
+ * Another comment
+ */
+
+ /*****************
+ *
+ * Final comment.
+ *
+ *****************/
+ }
+</pre>
+</td>
+</tr>
+</table>
+</center>
+<p>
+<hr>
+<p>
+A comment starts with a <b>/*</b> and
+ends with <b>*/</b>. Comments started in this way can span multiple
+lines but cannot be nested.
+For example:
+<p>
+<center>
+<table border=2 width="80%" bgcolor=ivory>
+<tr>
+<td>
+<pre>
+
+ main()
+ {
+ int Count = 0; /* Initalise
+ * Counter to 0 */
+
+ /* /* Invalid comment */ */
+ }
+</pre>
+</td>
+</tr>
+</table>
+</center>
+<p>
+This will give a syntax error, because the last line
+contains nested comments.
+<font color=brown>
+C++ offers a solution to
+<a href="../../CPLUSPLUS/SYNTAX/comment.html">comment nesting.</a>
+
+<p>
+<a name="c++">
+<hr>
+<font color=brown>
+<h2>C++ Extension</h3>
+<img src="../../GRAPHICS/whiteball.gif">
+<a href="../../CPLUSPLUS/SYNTAX/comment.html">Inline comments</a>
+</font>
+<p>
+
+<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="../master_index.html"> Master Index</a>
+</td><td width="25%">
+<a href="keywords.html"> Keywords</a>
+</td><td width="25%">
+<a href="../FUNCTIONS/funcref.htm"> Functions</a>
+</td>
+</tr>
+</table>
+</center>
+<p>
+<hr>
+<address>Martin Leslie
+</address><p>
+</body>
+</html>