<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.hard-light.org/index.php?action=history&amp;feed=atom&amp;title=Coding_In_C</id>
	<title>Coding In C - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.hard-light.org/index.php?action=history&amp;feed=atom&amp;title=Coding_In_C"/>
	<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Coding_In_C&amp;action=history"/>
	<updated>2026-11-15T10:36:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Coding_In_C&amp;diff=58758&amp;oldid=prev</id>
		<title>PIe: /* Tutorial One - Baby Steps */</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Coding_In_C&amp;diff=58758&amp;oldid=prev"/>
		<updated>2019-05-06T05:02:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Tutorial One - Baby Steps&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:02, 6 May 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l115&quot;&gt;Line 115:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 115:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;!&lt;/del&gt;#include &amp;lt;stdio.h&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;#include &amp;lt;stdio.h&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This line puts the contents of the file &amp;quot;stdio.h&amp;quot; into the current source code file after it&amp;#039;s loaded into memory but before it&amp;#039;s compiled. The &amp;#039;&amp;lt;&amp;#039; and &amp;#039;&amp;gt;&amp;#039; tell the compiler that it&amp;#039;s a library file - that is, it&amp;#039;s not part of the current program but in the compiler&amp;#039;s own file list. We need this file to get the function declaration for puts().&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This line puts the contents of the file &amp;quot;stdio.h&amp;quot; into the current source code file after it&amp;#039;s loaded into memory but before it&amp;#039;s compiled. The &amp;#039;&amp;lt;&amp;#039; and &amp;#039;&amp;gt;&amp;#039; tell the compiler that it&amp;#039;s a library file - that is, it&amp;#039;s not part of the current program but in the compiler&amp;#039;s own file list. We need this file to get the function declaration for puts().&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PIe</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Coding_In_C&amp;diff=18747&amp;oldid=prev</id>
		<title>TopAce: category</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Coding_In_C&amp;diff=18747&amp;oldid=prev"/>
		<updated>2008-09-24T17:33:27Z</updated>

		<summary type="html">&lt;p&gt;category&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:33, 24 September 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note: While the following guide is a starter, the book The C Programming Language, Second Edition by Brian W. Kernighan and Dennis M. Ritchie, is considered one of the best books on the C language.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note: While the following guide is a starter, the book The C Programming Language, Second Edition by Brian W. Kernighan and Dennis M. Ritchie, is considered one of the best books on the C language.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l284&quot;&gt;Line 284:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 283:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Written by [[User:WMCoolmon|WMCoolmon]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Written by [[User:WMCoolmon|WMCoolmon]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Source Code Project]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>TopAce</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Coding_In_C&amp;diff=10747&amp;oldid=prev</id>
		<title>AcePace: -Added a book reccomendation as per talk page.</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Coding_In_C&amp;diff=10747&amp;oldid=prev"/>
		<updated>2007-07-19T15:14:05Z</updated>

		<summary type="html">&lt;p&gt;-Added a book reccomendation as per talk page.&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:14, 19 July 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Note: While the following guide is a starter, the book The C Programming Language, Second Edition by Brian W. Kernighan and Dennis M. Ritchie, is considered one of the best books on the C language.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==File types==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==File types==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are two main types of file types in C/C++; .c/.cpp files, and .h files. .c/.cpp files are the meat of the source code; they contain the actual function and variable definitions. When a program is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;built&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, it is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;compiled&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; to create machine-readable code. To form a complete program, the machine code is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;linked&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; with other compiled .c/.cpp files to form the complete program (the .exe).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are two main types of file types in C/C++; .c/.cpp files, and .h files. .c/.cpp files are the meat of the source code; they contain the actual function and variable definitions. When a program is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;built&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, it is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;compiled&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; to create machine-readable code. To form a complete program, the machine code is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;linked&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; with other compiled .c/.cpp files to form the complete program (the .exe).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>AcePace</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Coding_In_C&amp;diff=4724&amp;oldid=prev</id>
		<title>WMCoolmon at 21:01, 11 January 2006</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Coding_In_C&amp;diff=4724&amp;oldid=prev"/>
		<updated>2006-01-11T21:01:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==File types==&lt;br /&gt;
There are two main types of file types in C/C++; .c/.cpp files, and .h files. .c/.cpp files are the meat of the source code; they contain the actual function and variable definitions. When a program is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;built&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, it is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;compiled&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; to create machine-readable code. To form a complete program, the machine code is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;linked&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; with other compiled .c/.cpp files to form the complete program (the .exe).&lt;br /&gt;
&lt;br /&gt;
.h files contain code, such as class, function, or struct definitions, that is used in multiple files but usually doesn&amp;#039;t really do anything when the program is built.&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
Anything after // is considered a comment and ignored. Also, anything between a /* and a */ is considered as well (This is called a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;block comment&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;). You may not put block comments inside of each other, although you can put pretty much anything else in them.&lt;br /&gt;
&lt;br /&gt;
Note that comments are not ignored if they are inside &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;strings&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; (read on to find out what strings are!).&lt;br /&gt;
&lt;br /&gt;
===Comments Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//I&amp;#039;m a comment!&lt;br /&gt;
/* So am I.*/&lt;br /&gt;
/* Look, you can do //this and //this! */&lt;br /&gt;
char String[] = &amp;quot;//I look like a comment but I&amp;#039;m really a string.&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
C and C++ have a number of different types of variables; these are slices of memory that hold information. Because all variables are stored in binary, they are interchangeable, to a degree. &amp;#039;&amp;#039;&amp;#039;All variables are case sensitive&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
For example, an &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;int&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is an integer, or a number without any fractions or decimals; -2,-1,0,1,2,3,4,5...etc. An integer is 4 bytes, or 32-bits, long.&lt;br /&gt;
&lt;br /&gt;
Another important type of variable is &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;char&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. A char is one byte (8 bits) in size. It&amp;#039;s essentially a shorter int, except it&amp;#039;s most commonly used to represent a character, that is, letters and numbers and such. This means that any given letter is also a number; &amp;#039;A&amp;#039; is 65, for example. This text-&amp;gt;number conversion is called [http://www.cplusplus.com/doc/papers/ascii.html ASCII]. Single quotation marks are used to denote a character. For example, &amp;#039;A&amp;#039;&lt;br /&gt;
&lt;br /&gt;
A collection of characters is called a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;string&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;; this isn&amp;#039;t really a variable, however, it is standard. A string is a series of characters followed by a null character, or a char with a value of 0. (NOT the character &amp;#039;0&amp;#039;; that would be 48). Double quotation marks are used to denote a string. So, &amp;quot;This is a string&amp;quot;. &amp;#039;This is not a string&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to use decimals or fractions you&amp;#039;ll have to use a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;float&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; or a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;double&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. A float is the same size as an int, except it can be fractions. A &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;double&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; is twice as large as an int (8 bytes) but can be much more accurate than a float.&lt;br /&gt;
&lt;br /&gt;
Finally, all the above integers can be prefixed with &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;unsigned&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;; this means that the variable only contains positive values. The &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;extern&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; prefix indicates that the variable exists, but is in some other file, so the compiler should let it be used. (The linker will complain if it doesn&amp;#039;t really exist). &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;const&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; means that the variable can&amp;#039;t be changed by the program after it&amp;#039;s built, which lets addtional optimizations be performed. Some other prefixes are &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;short&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;long&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; - look them up if you&amp;#039;re interested.&lt;br /&gt;
&lt;br /&gt;
===Variable example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int i;                   //Create the variable i.&lt;br /&gt;
i = 42;                  //Set i equal to 42&lt;br /&gt;
int j = 94;              //Create the variable j and set it to 94&lt;br /&gt;
j = -1 * (i * j + 1138); //You can also use arithmetic signs - Now j is -5086!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arrays==&lt;br /&gt;
An array is a series of the same type of variable. So, a string would be an array of chars. An individual variable in an array is usually called an &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;element&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Array example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int Array[2];               //Create an integer array with two integers&lt;br /&gt;
Array~[0] = 42;              //Set the first integer to 42&lt;br /&gt;
Array~[1] = 94;              //Set the second integer to 94&lt;br /&gt;
char String[] = &amp;quot;Hello!&amp;quot;;   //Create an array of chars (a string) and autosize it to whatever size the given string is&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Pointers==&lt;br /&gt;
Pointers are difficult to grasp and work with, to say the least, but they&amp;#039;re worth it. A pointer is basically the address of a particular variable (sometimes a function). Think of them as the address to a house, or the URL to a site - they aren&amp;#039;t the actual house or site, but they let you get to it.&lt;br /&gt;
&lt;br /&gt;
There are two important characters with pointers - &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;amp;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;*&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. &amp;amp; is used to change a variable to the address of a variable. So, &amp;amp;variable would give you the address of a variable.&lt;br /&gt;
&lt;br /&gt;
The asterisk is the reverse of &amp;amp;. It means the variable at the address given. In other words, *(&amp;amp;variable) is the same thing as variable.&lt;br /&gt;
&lt;br /&gt;
However, the asterisk can also be used to declare a pointer, a special type of variable. Confused yet? Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
===Pointer example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int i = 42;         //Our favorite integer, i&lt;br /&gt;
int *integerptr;    //This defines a pointer to an integer.&lt;br /&gt;
integerptr = &amp;amp;i;    //integerptr now points to i&lt;br /&gt;
(*integerptr) = 94; //We just changed the value of i!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
A function is a collection of instructions (usually other functions). Every function has a return type - even if it doesn&amp;#039;t. A function with no return type has a return type of &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;void&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. Otherwise, a function may return with any of the above variable types (A function can&amp;#039;t really return a string or array, although it can return a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;pointer&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; to one).&lt;br /&gt;
&lt;br /&gt;
Functions can also be given arguments, so one function can be used in different places. These arguments can be the same types as a function&amp;#039;s return types. This means you can take the return of one function and plug it into another function&amp;#039;s arguments.&lt;br /&gt;
&lt;br /&gt;
There are two steps to creating a function. Actually writing the function, and optionally declaring it. Thus, you can declare a function in a header file and use that function through your entire project, but only have the meat of it in one spot. You must declare or write out the function before you use it.&lt;br /&gt;
&lt;br /&gt;
Note that the arguments to a function are not really the variables that are plugged into them. So, if you want to change a variable from inside a function , you will probably have to use a pointer. This is called &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;passing by reference&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Function example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void func1(int a, float b);  //Declare func1&lt;br /&gt;
int func2()                  //Define func2&lt;br /&gt;
{&lt;br /&gt;
	return 1;            //func2 returns integer 1;&lt;br /&gt;
}&lt;br /&gt;
int func3(int c)             //Define func3&lt;br /&gt;
{&lt;br /&gt;
	func1(c, c + .5);    //execute func1&lt;br /&gt;
	return c;            //return c;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void func1(int a, float b)     //Define func1. It doesn&amp;#039;t do anything, basically.&lt;br /&gt;
{&lt;br /&gt;
	float z = a + b;       //Make a new variable and add up a and b in it&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Execute()                 //You can&amp;#039;t execute a function except from inside another.&lt;br /&gt;
{&lt;br /&gt;
	func1(func2(), func3(func2())); //What will z be?&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Tutorial One - Baby Steps==&lt;br /&gt;
To start out, I&amp;#039;ll give a classic example - a &amp;quot;Hello, World!&amp;quot; program written in C. Are you ready? Here it is...&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char** argv)&lt;br /&gt;
{&lt;br /&gt;
	puts(&amp;quot;Hello, world!&amp;quot;);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
That wasn&amp;#039;t too bad, was it? Here&amp;#039;s what each line does:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;!#include &amp;lt;stdio.h&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This line puts the contents of the file &amp;quot;stdio.h&amp;quot; into the current source code file after it&amp;#039;s loaded into memory but before it&amp;#039;s compiled. The &amp;#039;&amp;lt;&amp;#039; and &amp;#039;&amp;gt;&amp;#039; tell the compiler that it&amp;#039;s a library file - that is, it&amp;#039;s not part of the current program but in the compiler&amp;#039;s own file list. We need this file to get the function declaration for puts().&lt;br /&gt;
&lt;br /&gt;
The entire line is called a &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;preprocessor directive&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;; that&amp;#039;s what the &amp;#039;#&amp;#039; is for. The preprocessor does everything before the code is compiled, adding or replacing source code before it&amp;#039;s sent off to the compiler. It&amp;#039;s useful if you want to make it easy to completely remove a feature from a program.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;int main(int argc, char** argv)&amp;lt;/pre&amp;gt;&lt;br /&gt;
This defines the main function, which is where execution in a C program always starts. Argc is the number of command-line arguments, argv is the array of command-line arguments. (ie argv[0] might be &amp;quot;-fps&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{&amp;lt;/pre&amp;gt;&lt;br /&gt;
Starts the main function&amp;#039;s code block&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;puts(&amp;quot;Hello, world!&amp;quot;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
This function writes &amp;quot;Hello, world!&amp;quot; to the command-line, or console if you&amp;#039;re on Linux.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;return 0;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This can return pretty much anything you like, as long as it&amp;#039;s an integer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Ends the function block&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it! A working C program!&lt;br /&gt;
&lt;br /&gt;
==Scope==&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;scope&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; of a variable is the area you can get at it. A variable created inside a function only exists inside that function. Basically, anywhere you see brackets like { or } defines a code block. Any time you see these, variables created inside them will only exist inside of them.&lt;br /&gt;
&lt;br /&gt;
===Scope Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int a = 1;&lt;br /&gt;
void func1()&lt;br /&gt;
{&lt;br /&gt;
	//You can access a here, but not c or d&lt;br /&gt;
	int b;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void func2()&lt;br /&gt;
{&lt;br /&gt;
	//You can access a here, but not b or d&lt;br /&gt;
	if(a)&lt;br /&gt;
	{&lt;br /&gt;
		int d = 2;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Flow control - If statement==&lt;br /&gt;
If the code in the parentheses is true, or a nonzero value, then the code statement immediately after it or inside the code block immediately after it is executed. After if, &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;else if&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; may be used to define an alternate option. Or, &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;else&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; may be used to define if none of the else or else if blocks are true&lt;br /&gt;
&lt;br /&gt;
===If example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int a = 1;&lt;br /&gt;
int b = 2;&lt;br /&gt;
if(a == 0)&lt;br /&gt;
{&lt;br /&gt;
	//Do something fun if a is 0&lt;br /&gt;
}&lt;br /&gt;
else if(a == 1)&lt;br /&gt;
{&lt;br /&gt;
	//Do something else if a is 1&lt;br /&gt;
}&lt;br /&gt;
else if(a == 1 &amp;amp;&amp;amp; b == 2)&lt;br /&gt;
{&lt;br /&gt;
	//If a is 1, and b is 2, do something here.&lt;br /&gt;
	//With the above values, this is what would happen.&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
	//Otherwise, do this.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Flow control - while statement.==&lt;br /&gt;
While the code in the parentheses is true or a nozero value, then the code statement immediately after it or inside the code block immediately after it is executed.&lt;br /&gt;
&lt;br /&gt;
===While example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int i;         //Create the variable i&lt;br /&gt;
void DoStuff();//Declare teh function DoStuff&lt;br /&gt;
&lt;br /&gt;
i = 0;         //Make i be 0&lt;br /&gt;
while(i &amp;lt; 42)  //While this is true, do whatever&amp;#039;s after this&lt;br /&gt;
{&lt;br /&gt;
	DoStuff();&lt;br /&gt;
	i++;   //++ is shorthand for &amp;quot;Add 1 to the variable after this line of code&amp;quot;.&lt;br /&gt;
	//++i; //This would be shorthand for &amp;quot;Add 1 to the variable before this line of code&amp;quot;&lt;br /&gt;
               //Replace with -- for &amp;quot;Subtract one from&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Flow control - for statement==&lt;br /&gt;
Usually used to go through array values; essentially a variant of the while loop&lt;br /&gt;
&lt;br /&gt;
===For example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//This does the same thing as the while example&lt;br /&gt;
int i;&lt;br /&gt;
void DoStuff();&lt;br /&gt;
&lt;br /&gt;
for(i = 0; i &amp;lt; 42; i++)&lt;br /&gt;
{&lt;br /&gt;
	DoStuff();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Flow control - switch==&lt;br /&gt;
Execute the code after the case statement that matches the value in the parentheses.&lt;br /&gt;
&lt;br /&gt;
===Switch example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//Declare some functions&lt;br /&gt;
void DoFunStuff();&lt;br /&gt;
void DoSadStuff();&lt;br /&gt;
void DoOtherStuff();&lt;br /&gt;
&lt;br /&gt;
//Give ourselves a variable&lt;br /&gt;
int a = 2;&lt;br /&gt;
&lt;br /&gt;
switch(a)&lt;br /&gt;
{&lt;br /&gt;
	case 0:        		//If a is 0...&lt;br /&gt;
		DoFunStuff();	//...Do fun stuff!&lt;br /&gt;
		break;		//We&amp;#039;re done, jump to the end of the code block.&lt;br /&gt;
	case 1:        		//If a is 1...&lt;br /&gt;
		DoSadStuff();	//...aww, crap, we gotta do sad stuff.&lt;br /&gt;
		break;&lt;br /&gt;
	default:		//If none of the above match...&lt;br /&gt;
		DoOtherStuff();	//...Do some other stuff.&lt;br /&gt;
				//Since a IS 2, we&amp;#039;ll be doing this other stuff.&lt;br /&gt;
		break;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structs==&lt;br /&gt;
Structs are a block of different types of variables. They help organize code, since then you can group similar variables together. For example:&lt;br /&gt;
&lt;br /&gt;
===Struct Example===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct Person&lt;br /&gt;
{&lt;br /&gt;
	char name[128];     //Name can *only* be 128 letters long, including spaces&lt;br /&gt;
	unsigned int age;   //Granted, ints range from -2,147,483,648 to 2,147,483,648 - but just in case...&lt;br /&gt;
	unsigned int weight;//Who has negative weight?&lt;br /&gt;
&lt;br /&gt;
}; //&amp;lt;-- this little semicolon is important. Remember him.&lt;br /&gt;
&lt;br /&gt;
//Now we have a function that takes a Person as an argument.&lt;br /&gt;
int CarlEatClone(Person poor_fellow)&lt;br /&gt;
{&lt;br /&gt;
	for(;poor_Fellow.weight &amp;gt; 0; poor_fellow.weight--);     //Simulate this poor fellow being digested.&lt;br /&gt;
&lt;br /&gt;
	//Note that no one is actually harmed, because the poor_fellow is actually a copy.&lt;br /&gt;
	//Also note how &amp;quot;weight&amp;quot; inside poor_fellow is referenced&lt;br /&gt;
}&lt;br /&gt;
//Use like this:&lt;br /&gt;
//CarlEatClone(TerranGuy);&lt;br /&gt;
&lt;br /&gt;
//In this function, poor_fellow must be a pointer&lt;br /&gt;
int CarlEat(Person *poor_fellow)&lt;br /&gt;
{&lt;br /&gt;
	for(;poor_fellow-&amp;gt;weight &amp;gt; 0; poor_fellow-&amp;gt;weight--);&lt;br /&gt;
&lt;br /&gt;
	//Note again how weight is referenced, now that poor_fellow is a pointer&lt;br /&gt;
	//No cloning is involved here...poor guy.&lt;br /&gt;
}&lt;br /&gt;
//Use like this:&lt;br /&gt;
//CarlEat(&amp;amp;TerranGuy);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Written by [[User:WMCoolmon|WMCoolmon]]&lt;/div&gt;</summary>
		<author><name>WMCoolmon</name></author>
	</entry>
</feed>