<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.wiki.mohid.com/index.php?action=history&amp;feed=atom&amp;title=Cpp</id>
		<title>Cpp - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.wiki.mohid.com/index.php?action=history&amp;feed=atom&amp;title=Cpp"/>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Cpp&amp;action=history"/>
		<updated>2026-04-05T01:39:30Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.28.0</generator>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Cpp&amp;diff=3189&amp;oldid=prev</id>
		<title>Guillaume: /* Structures */</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Cpp&amp;diff=3189&amp;oldid=prev"/>
				<updated>2010-06-12T11:15:44Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Structures&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 11:15, 12 June 2010&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-l138&quot; &gt;Line 138:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 138:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Structures are composites of several types of variables. A typical syntax example would be:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Structures are composites of several types of variables. A typical syntax example would be:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[c,Y] &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;htm&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;pre name=&amp;quot;&lt;/ins&gt;code&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot; class=&amp;quot;c&amp;quot;&lt;/ins&gt;&amp;gt; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; struct s_myexample{&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; struct s_myexample{&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; char a;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; char a;&lt;/div&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-l146&quot; &gt;Line 146:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 147:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; char ext = s_myexample.a;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; char ext = s_myexample.a;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; 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;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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 class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/htm&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Combining structures with casts is much more useful:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Combining structures with casts is much more useful:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Guillaume</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Cpp&amp;diff=163&amp;oldid=prev</id>
		<title>Guillaume: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Cpp&amp;diff=163&amp;oldid=prev"/>
				<updated>2008-12-03T10:27:01Z</updated>
		
		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:27, 3 December 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;' lang='en'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Guillaume</name></author>	</entry>

	<entry>
		<id>http://www.wiki.mohid.com/index.php?title=Cpp&amp;diff=162&amp;oldid=prev</id>
		<title>89.180.146.64: /* IO string manipulations */</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.mohid.com/index.php?title=Cpp&amp;diff=162&amp;oldid=prev"/>
				<updated>2008-03-15T01:23:06Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;IO string manipulations&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This page is kind of a handbook for writing c and c++ programs. References to practical issues are assigned to this page.&lt;br /&gt;
&lt;br /&gt;
== GOLDEN RULES ==&lt;br /&gt;
&lt;br /&gt;
# '''In a function, never pass the arguments by value, always pass them by reference'''&lt;br /&gt;
&lt;br /&gt;
== Single file [http://en.wikipedia.org/wiki/ANSI_C ANSI C] project template ==&lt;br /&gt;
&lt;br /&gt;
Here's a basic template for a single-file project:&lt;br /&gt;
&amp;lt;code&amp;gt;[c,Y]&lt;br /&gt;
 /*Template for a [http://en.wikipedia.org/wiki/ANSI_C ANSI C] standard program file*/&lt;br /&gt;
 &lt;br /&gt;
 /*Place the headers here*/&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;math.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 /*Place the Macros here*/&lt;br /&gt;
 #define OK_         1&lt;br /&gt;
 &lt;br /&gt;
 /*Place the Casts here*/&lt;br /&gt;
 typedef double REAL_T; &lt;br /&gt;
 &lt;br /&gt;
 /*Place the subroutines declaration here*/&lt;br /&gt;
 REAL_T deg(REAL_T x);&lt;br /&gt;
 &lt;br /&gt;
 /*Main routine*/&lt;br /&gt;
 int main(int argc, char* argv[])&lt;br /&gt;
 {&lt;br /&gt;
    /*...*/&lt;br /&gt;
    return 1;&lt;br /&gt;
 }&lt;br /&gt;
 /*Subroutines*/&lt;br /&gt;
 REAL_T deg(REAL_T x){&lt;br /&gt;
         return x/fabs(x)*floor(fabs(x));&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mixing C and C++ code ==&lt;br /&gt;
&lt;br /&gt;
In order to mix C routines within a C++ structure simply make sure that the C routines are written in standard [http://en.wikipedia.org/wiki/ANSI_C ANSI C] and that they're all in a separate file. Then include ''extern &amp;quot;C&amp;quot;'' syntax. Here's an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp,Y]&lt;br /&gt;
 #include &amp;lt;sstream&amp;gt;&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 #include &amp;lt;math.h&amp;gt;&lt;br /&gt;
 extern &amp;quot;C&amp;quot;{&lt;br /&gt;
         #include &amp;lt;fes.h&amp;gt;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using namespaces ==&lt;br /&gt;
&lt;br /&gt;
Whenever one whishes to use C++ STL standard libraries then one has to use the '''std::''' namespace. Or it can be declared in the beginning of the routine or of the code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp,Y] &lt;br /&gt;
 #include &amp;lt;vector&amp;gt;&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 #include &amp;lt;sstream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 int main()&lt;br /&gt;
 {&lt;br /&gt;
     std::string str;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp,Y] &lt;br /&gt;
 #include &amp;lt;vector&amp;gt;&lt;br /&gt;
 #include &amp;lt;string&amp;gt;&lt;br /&gt;
 #include &amp;lt;sstream&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main()&lt;br /&gt;
 {&lt;br /&gt;
     string str;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variables in C and C++ ==&lt;br /&gt;
&lt;br /&gt;
There are several built-in types of variables:&lt;br /&gt;
&amp;lt;code&amp;gt;[c,Y] &lt;br /&gt;
   char c; //byte size character [0x0-FFx0]&lt;br /&gt;
   short int sn; //byte sized integer [0-255]&lt;br /&gt;
   int n; //word(2bytes) sized integer [0-16556]&lt;br /&gt;
   long ln; // 4 byte sized integer&lt;br /&gt;
   float x; // single precision real number&lt;br /&gt;
   double dx; // double precision real number&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
=== Memory structure and pointers ===&lt;br /&gt;
In C coding, a variable is in fact the combination of two elements: its value and its pointer:&lt;br /&gt;
*The value is a memory register where the variable value is stored.&lt;br /&gt;
*The pointer is another memory register containing the memory address of the variable value. &lt;br /&gt;
Thus the pointer points to the variable value.&lt;br /&gt;
&amp;lt;code&amp;gt;[c,Y] &lt;br /&gt;
   char* c_p; //pointer to characters&lt;br /&gt;
   short int* sn_p; //pointer to short integers&lt;br /&gt;
   int* n_p; //pointer to integers&lt;br /&gt;
   long* ln_p; // pointer to long integers&lt;br /&gt;
   float* x_p; // pointer to single precision real numbers&lt;br /&gt;
   double* dx_p; // pointer to double precision real numbers&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
==== Allocate arrays ====&lt;br /&gt;
&lt;br /&gt;
In C, pointers allow to allocate arrays (blocks of memory) of a given variable single type...&lt;br /&gt;
Here's an example of allocating a memory block:&lt;br /&gt;
&amp;lt;code&amp;gt;[c,Y] &lt;br /&gt;
 double* vector_p;    //Allocates the memory register of the pointer, and fills it with dumb address&lt;br /&gt;
 vector_p = (double*) malloc( sizeof(double)*(N + 2*p) ) // Allocates a block of memory and assigns&lt;br /&gt;
                                                 //its memory address to vector_p.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [http://en.wikipedia.org/wiki/Cast_%28computer_science%29 Cast] of types of variables ===&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Cast_%28computer_science%29 Casts] are a very useful feature of [http://en.wikipedia.org/wiki/C_programming_language C programming language]. They allow to define custom types of variables. They are defined at the beginning of the code. When well used, [http://en.wikipedia.org/wiki/Cast_%28computer_science%29 casts] allow easy portability from single to double precision computing. Here are a few examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[c,Y] &lt;br /&gt;
 typedef float REAL_SCALAR_T;&lt;br /&gt;
 /*typedef double REAL_SCALAR_T;*/&lt;br /&gt;
 typedef REAL_SCALAR_T* REAL_VECTOR_T;&lt;br /&gt;
 &lt;br /&gt;
 REAL_SCALAR_T x = 3.1416;&lt;br /&gt;
 REAL_VECTOR_T vx;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code defines single precision scalar and vector variables types.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[c,Y] &lt;br /&gt;
 typedef int INT_SCALAR_T;&lt;br /&gt;
 /*typedef long INT_SCALAR_T;*/&lt;br /&gt;
 typedef INT_SCALAR_T* INT_VECTOR_T;&lt;br /&gt;
 &lt;br /&gt;
 INT_SCALAR_T n = 7;&lt;br /&gt;
 INT_VECTOR_T v;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code defines single precision integer and integer vector variables types.&lt;br /&gt;
&lt;br /&gt;
=== Structures ===&lt;br /&gt;
Structures are composites of several types of variables. A typical syntax example would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[c,Y] &lt;br /&gt;
 struct s_myexample{&lt;br /&gt;
    char a;&lt;br /&gt;
    int b;	&lt;br /&gt;
    float* ptr_p;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 char ext = s_myexample.a;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Combining structures with casts is much more useful:&lt;br /&gt;
&amp;lt;code&amp;gt;[c,Y] &lt;br /&gt;
 typedef struct s_myexample{&lt;br /&gt;
       char a;&lt;br /&gt;
       int b;&lt;br /&gt;
       s_myexample_t* myotherexample_p;&lt;br /&gt;
 }s_myexample_t;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [http://en.wikipedia.org/wiki/Macro Macros] ==&lt;br /&gt;
&lt;br /&gt;
The C or C++ compiler comes with [http://en.wikipedia.org/wiki/Preprocessor preprocessing] capabilities. Hence [http://en.wikipedia.org/wiki/Macro macros] are allowed, but use them with care. Here are a few examples for syntax purposes. Preferrably, define at head of the code.&lt;br /&gt;
&amp;lt;code&amp;gt;[c,Y] &lt;br /&gt;
 #define OK_        1&lt;br /&gt;
 #define BAD_      -1&lt;br /&gt;
 #define DATA_      1&lt;br /&gt;
 #define INPUT_     2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== IO string manipulations ==&lt;br /&gt;
&lt;br /&gt;
To perform simple output to the console:&lt;br /&gt;
&amp;lt;code&amp;gt;[cpp,Y] &lt;br /&gt;
 std::cout &amp;lt;&amp;lt; &amp;quot;ERROR: Too many parameters included in command line!\n&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building the project ==&lt;br /&gt;
&lt;br /&gt;
=== Building a single file project ===&lt;br /&gt;
 g++ -c -o example.o -Iincludepath example.cpp&lt;br /&gt;
 g++ -o example.exe -Llibpath example.o alibrary.a&lt;br /&gt;
The first line compiles example.cpp and outputs the object example.o. The second line links the object file agains a library (static or shared).&lt;br /&gt;
&lt;br /&gt;
=== Building a several files project ===&lt;br /&gt;
 CC=&amp;quot;g++&amp;quot;&lt;br /&gt;
 INC=&amp;quot;-Iincludepath1 -Iincludepath2 -Iincludepath3&amp;quot;&lt;br /&gt;
 LIB=&amp;quot;-Llibpath1 -Llibpath2&amp;quot;&lt;br /&gt;
 SRC=&amp;quot;file1.cpp file2.cpp file3.cpp&amp;quot;&lt;br /&gt;
 OBJ=&amp;quot;file1.o file2.o file3.o lib1.a lib2.a&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 $CC -c $INC $SRC&lt;br /&gt;
 $CC -o example.exe $LIB $OBJ&lt;br /&gt;
The first line compiles and returns the object files. The second line links against the libraries (static or shared).&lt;br /&gt;
&lt;br /&gt;
=== Creating a makefile for the project ===&lt;br /&gt;
&lt;br /&gt;
Usually, the [http://en.wikipedia.org/wiki/Integrated_Development_Environment IDE] takes care of the [http://en.wikipedia.org/wiki/Make making] of the project. However when porting to other environments such as [[*NIX platforms]] then one may want to consider to create a [[makefile]].&lt;br /&gt;
[[Category:Technology]]&lt;br /&gt;
[[Category:Programming]]&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:Windows]]&lt;/div&gt;</summary>
		<author><name>89.180.146.64</name></author>	</entry>

	</feed>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-56589921-5', 'auto');
  ga('send', 'pageview');
</script>