<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Helping Online Entrepreneurs &#187; C/C++</title>
	<atom:link href="http://www.codeitwell.com/category/programming/c-cpp/feed" rel="self" type="application/rss+xml" />
	<link>http://www.codeitwell.com</link>
	<description>With Resources on How to Make Money Online doing Freelancing, Affiliate Marketing, Blogging and many more ...</description>
	<lastBuildDate>Wed, 09 Feb 2011 11:39:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Good C++ Books</title>
		<link>http://www.codeitwell.com/good-cpp-books.html</link>
		<comments>http://www.codeitwell.com/good-cpp-books.html#comments</comments>
		<pubDate>Fri, 17 Jul 2009 10:38:23 +0000</pubDate>
		<dc:creator>Shabbir</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[C]]></category>

		<guid isPermaLink="false">http://www.codeitwell.com/?p=219</guid>
		<description><![CDATA[I have used Google book search to find some of the best books in c++. Here are my collection. Nice book to start with your C++ learning and it should be one of the first book to start with. It covers all the basics about C++ in a very simple and easy way. Google book [...]


More Related Posts:<ol><li><a href='http://www.codeitwell.com/how-some-of-the-programming-languages-are-named.html' rel='bookmark' title='Permanent Link: How some of the programming languages are named'>How some of the programming languages are named</a></li>
<li><a href='http://www.codeitwell.com/pointers.html' rel='bookmark' title='Permanent Link: Pointers'>Pointers</a></li>
<li><a href='http://www.codeitwell.com/increment-and-decrement-operators.html' rel='bookmark' title='Permanent Link: Increment and Decrement Operators'>Increment and Decrement Operators</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>I have used <a href="http://books.Google.com/">Google book search</a> to find some of the best books in c++.</p>
<p>Here are my collection.</p>
<table border="0">
<tbody>
<tr>
<td><img class="alignnone size-full wp-image-226" title="masterting-cpp" src="http://www.codeitwell.com/wp-content/uploads/2009/07/masterting-cpp.jpg" alt="masterting-cpp" width="128" height="181" /></td>
<td valign="top">Nice book to start with your C++ learning and it should be one of the first book to start with. It covers all the basics about C++ in a very simple and easy way.<br />
<a href="http://books.google.com/books?id=2soaY85jGQIC&amp;lpg=PP1&amp;pg=PP1#v=onepage&amp;q=&amp;f=false" target="_blank">Google book preview</a></td>
</tr>
<tr>
<td><img class="alignnone size-full wp-image-227" title="oop-cpp" src="http://www.codeitwell.com/wp-content/uploads/2009/07/oop-cpp.jpg" alt="oop-cpp" width="128" height="173" /></td>
<td valign="top">This is a very simple C++ book but also contains many errors when it comes to object oriented concept and so unless your tutor follows this, it can be avoided.<br />
<a href="http://books.google.com/books?id=Zkn_ogWiHyEC&amp;lpg=PP1&amp;pg=PP1#v=onepage&amp;q=&amp;f=false" target="_blank">Google book preview</a></td>
</tr>
<tr>
<td><img class="alignnone size-full wp-image-220" title="cpp-complete-guide" src="http://www.codeitwell.com/wp-content/uploads/2009/07/cpp-complete-guide.jpg" alt="cpp-complete-guide" width="128" height="157" /></td>
<td valign="top">This is one of the best book in C++ for starters as well as for intermediate users and has been awarded best book of the month by oxford journals. Its a must have book for any C++ learner.<br />
<a href="http://books.google.com/books?id=-yhuY0Wg_QcC&amp;lpg=PP1&amp;dq=complete%20guide%20to%20C%2B%2B&amp;pg=PP1#v=onepage&amp;q=&amp;f=false" target="_blank">Google book preview</a> | <a href="http://www.amazon.com/gp/product/0763718173?ie=UTF8&amp;tag=ciw-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0763718173" target="_blank">Amazon</a></td>
</tr>
<tr>
<td><img class="alignnone size-full wp-image-229" title="prog-cpp" src="http://www.codeitwell.com/wp-content/uploads/2009/07/prog-cpp.jpg" alt="prog-cpp" width="128" height="172" /></td>
<td valign="top">This is one of the book which has very simplistic approach when it comes to explanation but when it comes to exercise this is one of the better books to have. You should get the exercises from this book to get your hands on the programming.<br />
<a href="http://books.google.com/books?id=7MlRy62jGSYC&amp;lpg=PP1&amp;dq=complete%20guide%20to%20C%2B%2B&amp;pg=PP1#v=onepage&amp;q=complete%20guide%20to%20C++&amp;f=false" target="_blank">Google book preview</a> |<a href="http://www.amazon.com/gp/product/0071353461?ie=UTF8&amp;tag=ciw-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0071353461" target="_blank">Amazon</a></td>
</tr>
<tr>
<td><img class="alignnone size-full wp-image-222" title="cpp-nutshell" src="http://www.codeitwell.com/wp-content/uploads/2009/07/cpp-nutshell.jpg" alt="cpp-nutshell" width="128" height="186" /></td>
<td valign="top">This is more of a reference book which you should have in your collection for learning C++.<br />
<a href="http://books.google.com/books?id=91JTA9B_m44C&amp;lpg=PP1&amp;pg=PP1#v=onepage&amp;q=&amp;f=false" target="_blank">Google book preview</a> | <a href="http://www.amazon.com/gp/product/059600298X?ie=UTF8&amp;tag=ciw-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=059600298X" target="_blank">Amazon</a></td>
</tr>
<tr>
<td><img class="alignnone size-full wp-image-225" title="intro-oop-cpp" src="http://www.codeitwell.com/wp-content/uploads/2009/07/intro-oop-cpp.jpg" alt="intro-oop-cpp" width="128" height="183" /></td>
<td valign="top">This is for basic to intermediate level C++ programmer and approaches C++ programming the way it should be i.e. object oriented approach.<br />
<a href="http://books.google.com/books?id=HkbTLFitCgIC&amp;lpg=PP1&amp;pg=PP1#v=onepage&amp;q=&amp;f=false" target="_blank">Google book preview</a> | <a href="http://www.amazon.com/gp/product/1852334509?ie=UTF8&amp;tag=ciw-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1852334509" target="_blank">Amazon</a></td>
</tr>
<tr>
<td><img class="alignnone size-full wp-image-228" title="oop-cpp-engg-tech" src="http://www.codeitwell.com/wp-content/uploads/2009/07/oop-cpp-engg-tech.jpg" alt="oop-cpp-engg-tech" width="128" height="148" /></td>
<td valign="top">This book is more for intermediate to advance level C++ programmers but this also discusses the evolution of C++ based on "C" and so this book is for someone who is moving from C to C++.<br />
<a href="http://books.google.com/books?id=Miq73i_J1i4C&amp;lpg=PP1&amp;pg=PP1#v=onepage&amp;q=&amp;f=false" target="_blank">Google book preview</a> | <a href="http://www.amazon.com/gp/product/0766838943?ie=UTF8&amp;tag=ciw-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0766838943" target="_blank">Amazon</a></td>
</tr>
<tr>
<td><img class="alignnone size-full wp-image-230" title="using-cpp-stl" src="http://www.codeitwell.com/wp-content/uploads/2009/07/using-cpp-stl.jpg" alt="using-cpp-stl" width="128" height="170" /></td>
<td valign="top">Any C++ collection of books cannot be complete unless you have a good book on Standard Template Library ( STL ). This is the book for those who are familiar with basic to intermediate level of C++ programming.<br />
<a href="http://books.google.com/books?id=yOebRChQI3EC&amp;lpg=PP1&amp;dq=using%20stl&amp;pg=PP1#v=onepage&amp;q=&amp;f=false" target="_blank">Google book preview</a> | <a href="http://www.amazon.com/gp/product/0387988572?ie=UTF8&amp;tag=ciw-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0387988572" target="_blank">Amazon</a></td>
</tr>
<tr>
<td><img class="alignnone size-full wp-image-223" title="cpp-stl" src="http://www.codeitwell.com/wp-content/uploads/2009/07/cpp-stl.jpg" alt="cpp-stl" width="128" height="161" /></td>
<td valign="top">This is one of the better reference books for STL and a must for collection of good books in C++. It also has complete and comprehensive coverage of ANSI/ISO C++ standard.<br />
<a href="http://books.google.com/books?id=n9VEG2Gp5pkC&amp;lpg=PP1&amp;pg=PP1#v=onepage&amp;q=&amp;f=false" target="_blank">Google book preview</a> | <a href="http://www.amazon.com/gp/product/0201379260?ie=UTF8&amp;tag=ciw-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0201379260" target="_blank">Amazon</a></td>
</tr>
<tr>
<td><img class="alignnone size-full wp-image-224" title="ds-stl" src="http://www.codeitwell.com/wp-content/uploads/2009/07/ds-stl.jpg" alt="ds-stl" width="128" height="160" /></td>
<td valign="top">Finally we would have something which teaches more about Data Structures and their implementation using Standard Template Library ( STL ). This books explains the Data Structures briefly and some basic knowledge of Data Structure is an added advantage.<br />
<a href="http://books.google.com/books?id=fuwKO39aZdUC&amp;lpg=PA59&amp;dq=data%20structure%20and%20standard%20template%20library&amp;pg=PA59#v=onepage&amp;q=data%20structure%20and%20standard%20template%20library&amp;f=false" target="_blank">Google book preview</a> | <a href="http://www.amazon.com/gp/product/0072369655?ie=UTF8&amp;tag=ciw-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0072369655" target="_blank">Amazon</a></td>
</tr>
</tbody>
</table>


<br /><p>More Related Posts:<ol><li><a href='http://www.codeitwell.com/how-some-of-the-programming-languages-are-named.html' rel='bookmark' title='Permanent Link: How some of the programming languages are named'>How some of the programming languages are named</a></li>
<li><a href='http://www.codeitwell.com/pointers.html' rel='bookmark' title='Permanent Link: Pointers'>Pointers</a></li>
<li><a href='http://www.codeitwell.com/increment-and-decrement-operators.html' rel='bookmark' title='Permanent Link: Increment and Decrement Operators'>Increment and Decrement Operators</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codeitwell.com/good-cpp-books.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How some of the programming languages are named</title>
		<link>http://www.codeitwell.com/how-some-of-the-programming-languages-are-named.html</link>
		<comments>http://www.codeitwell.com/how-some-of-the-programming-languages-are-named.html#comments</comments>
		<pubDate>Sun, 24 Aug 2008 12:22:05 +0000</pubDate>
		<dc:creator>Shabbir</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://www.codeitwell.com/?p=42</guid>
		<description><![CDATA[PHP has come a long way in the last few years and now its one of the most popular known web language but has any one of us thought why the Name of the language is PHP and nothing else Or what is the full form of PHP. If No read through the complete post [...]


More Related Posts:<ol><li><a href='http://www.codeitwell.com/safe-programming.html' rel='bookmark' title='Permanent Link: Safe Programming'>Safe Programming</a></li>
<li><a href='http://www.codeitwell.com/increment-and-decrement-operators.html' rel='bookmark' title='Permanent Link: Increment and Decrement Operators'>Increment and Decrement Operators</a></li>
<li><a href='http://www.codeitwell.com/working-with-asp.html' rel='bookmark' title='Permanent Link: Working with ASP'>Working with ASP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>PHP has come a long way in the last few years and now its one of the most popular known web language but has any one of us thought why the Name of the language is PHP and nothing else Or what is the full form of PHP. If No read through the complete post here.</p>
<p>I don't know why but the first question that comes to my mind when I start on it is why the programming language name is what it is. </p>
<h3>C</h3>
<p>When I started on C the same question came to my mind and the answer this is what I found Dennis Ritchie of Bell Labs created the C Programming Language in 1971-1972 and at that time there were couple of languages like A and B before C language came into existence and so he named the awesome language as <strong>C</strong>.</p>
<h3>C++</h3>
<p>The same question came to mind when I started my quest to learn C++ and probably I found the answer too many times in each book of C++ and so I would not add much detail here. C++ was written by  Bjarne Stroustrup  at Bell Labs during 1983-1985. C++ is an extension of C and so was named with the postfix operator of C to give it one step forward then C.</p>
<h3>C#</h3>
<p>Couple of years back again the same question came for C# when I started on C# and .NET and the answer I found is # can be broken into ++++ and so its names as #. So now we can understand that C# is an extension of C++ but without backward compatibility with the same compiler.</p>
<h3>PHP</h3>
<p>Now the same question with PHP. Ohhh, too many questions haaan? But I found this answer the most interesting. </p>
<p>PHP was originally created Rasmus Lerdorf in 1995, and was just collection of some Perl scripts and library of C programs for tracking accesses to his online resume. Thus was born the first version of PHP. He named this set of scripts '<strong>P</strong>ersonal <strong>H</strong>ome <strong>P</strong>age Tools'. He confesses that he created PHP purely to serve his own interest, to solve his own set of problems. He made the source publicly available so others could benefit from it. That set the ball rolling.</p>


<br /><p>More Related Posts:<ol><li><a href='http://www.codeitwell.com/safe-programming.html' rel='bookmark' title='Permanent Link: Safe Programming'>Safe Programming</a></li>
<li><a href='http://www.codeitwell.com/increment-and-decrement-operators.html' rel='bookmark' title='Permanent Link: Increment and Decrement Operators'>Increment and Decrement Operators</a></li>
<li><a href='http://www.codeitwell.com/working-with-asp.html' rel='bookmark' title='Permanent Link: Working with ASP'>Working with ASP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codeitwell.com/how-some-of-the-programming-languages-are-named.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Safe Programming</title>
		<link>http://www.codeitwell.com/safe-programming.html</link>
		<comments>http://www.codeitwell.com/safe-programming.html#comments</comments>
		<pubDate>Fri, 22 Aug 2008 08:43:26 +0000</pubDate>
		<dc:creator>Shabbir</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Pointers]]></category>

		<guid isPermaLink="false">http://www.codeitwell.com/?p=40</guid>
		<description><![CDATA[Once doing Code Review I found a code snippet like this and so thought would share my experience here. CDialog *SomeDialog = new CMyDialog&#40;&#60;&#60;Some Param&#62;&#62;&#41;; SomeDialog-&#62;SomeFunction&#40;this&#41;; In the above code we always assume that SomeDialog is always allocated with the CMyDialog class pointer but that may not be the case always and so its always [...]


More Related Posts:<ol><li><a href='http://www.codeitwell.com/how-some-of-the-programming-languages-are-named.html' rel='bookmark' title='Permanent Link: How some of the programming languages are named'>How some of the programming languages are named</a></li>
<li><a href='http://www.codeitwell.com/elance-profile-widget.html' rel='bookmark' title='Permanent Link: Elance Profile Widget'>Elance Profile Widget</a></li>
<li><a href='http://www.codeitwell.com/follow-me-on-google-buzz.html' rel='bookmark' title='Permanent Link: Follow me On Google Buzz'>Follow me On Google Buzz</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>Once doing Code Review I found a code snippet like this and so thought would share my experience here.</p>
<pre class="cpp">CDialog *SomeDialog = <span style="color: #0000dd;">new</span> CMyDialog<span style="color: #000000;">&#40;</span>&lt;&lt;Some Param&gt;&gt;<span style="color: #000000;">&#41;</span>;
SomeDialog-&gt;SomeFunction<span style="color: #000000;">&#40;</span><span style="color: #0000dd;">this</span><span style="color: #000000;">&#41;</span>;</pre>
<p>In the above code we always assume that SomeDialog is always allocated with the CMyDialog class pointer but that may not be the case always and so its always better to have the code as follows.</p>
<pre class="cpp">CDialog *SomeDialog = <span style="color: #0000dd;">new</span> CMyDialog<span style="color: #000000;">&#40;</span>&lt;&lt;Some Param&gt;&gt;<span style="color: #000000;">&#41;</span>;
<span style="color: #0000ff;">if</span><span style="color: #000000;">&#40;</span>SomeDialog != <span style="color: #0000ff;">NULL</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    SomeDialog-&gt;SomeFunction<span style="color: #000000;">&#40;</span><span style="color: #0000dd;">this</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre>
<p>and it would always make your programming effort safer and subject to less crashes.</p>


<br /><p>More Related Posts:<ol><li><a href='http://www.codeitwell.com/how-some-of-the-programming-languages-are-named.html' rel='bookmark' title='Permanent Link: How some of the programming languages are named'>How some of the programming languages are named</a></li>
<li><a href='http://www.codeitwell.com/elance-profile-widget.html' rel='bookmark' title='Permanent Link: Elance Profile Widget'>Elance Profile Widget</a></li>
<li><a href='http://www.codeitwell.com/follow-me-on-google-buzz.html' rel='bookmark' title='Permanent Link: Follow me On Google Buzz'>Follow me On Google Buzz</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codeitwell.com/safe-programming.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2005 Non-Unicode compilation</title>
		<link>http://www.codeitwell.com/visual-studio-2005-non-unicode-compilation.html</link>
		<comments>http://www.codeitwell.com/visual-studio-2005-non-unicode-compilation.html#comments</comments>
		<pubDate>Sun, 17 Aug 2008 09:16:32 +0000</pubDate>
		<dc:creator>Shabbir</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.codeitwell.com/?p=37</guid>
		<description><![CDATA[Many developers like me tend to write code in ANSI compilation till we managed to get our hands on Visual Studio 2005 where the default setting is Unicode compilation and so you may need to be using the _T() / TEXT like function and if you are aware of them your life could become hell. [...]


More Related Posts:<ol><li><a href='http://www.codeitwell.com/creating-a-windows-forms-application-in-cs.html' rel='bookmark' title='Permanent Link: Creating a Windows Forms Application in C#'>Creating a Windows Forms Application in C#</a></li>
<li><a href='http://www.codeitwell.com/functions-in-cpp.html' rel='bookmark' title='Permanent Link: Functions in C++'>Functions in C++</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cpp.html' rel='bookmark' title='Permanent Link: Write To File In C++'>Write To File In C++</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>Many developers like me tend to write code in ANSI compilation till we managed to get our hands on Visual Studio 2005 where the default setting is Unicode compilation and so you may need to be using the _T() / TEXT like function and if you are aware of them your life could become hell.</p>
<p>So here is how to change that.</p>
<p>Go to Project Menu and select &lt;Project Name&gt; Properties.</p>
<p>Then Select the Configuration Properties in the Left Tree Menu</p>
<p><img src="http://www.codeitwell.com/images/non-unicode-compilation.jpg" alt="Non Unocode Compilation for Visual Studio 2005" /></p>
<p>You will see there Character Set and change that to Not Set.</p>
<p>Hurray you are done.</p>


<br /><p>More Related Posts:<ol><li><a href='http://www.codeitwell.com/creating-a-windows-forms-application-in-cs.html' rel='bookmark' title='Permanent Link: Creating a Windows Forms Application in C#'>Creating a Windows Forms Application in C#</a></li>
<li><a href='http://www.codeitwell.com/functions-in-cpp.html' rel='bookmark' title='Permanent Link: Functions in C++'>Functions in C++</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cpp.html' rel='bookmark' title='Permanent Link: Write To File In C++'>Write To File In C++</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codeitwell.com/visual-studio-2005-non-unicode-compilation.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Structures in C/C++</title>
		<link>http://www.codeitwell.com/structures-in-c-cpp.html</link>
		<comments>http://www.codeitwell.com/structures-in-c-cpp.html#comments</comments>
		<pubDate>Mon, 11 Aug 2008 19:39:33 +0000</pubDate>
		<dc:creator>Shabbir</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Structures]]></category>

		<guid isPermaLink="false">http://www.codeitwell.com/?p=36</guid>
		<description><![CDATA[Structures are a group of data elements, and we can access them using the structures. The data elements can be from any types. Sample of a structure struct StructName &#123; int i; char c; &#125; obj1, obj2; So, a structure is declared with the "struct" keyword, then comes its name. Then, in the braces we [...]


More Related Posts:<ol><li><a href='http://www.codeitwell.com/readwrite-registry-keys.html' rel='bookmark' title='Permanent Link: Read/Write Registry Keys'>Read/Write Registry Keys</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cpp.html' rel='bookmark' title='Permanent Link: Write To File In C++'>Write To File In C++</a></li>
<li><a href='http://www.codeitwell.com/adding-items-to-listview-control.html' rel='bookmark' title='Permanent Link: Adding Items to ListView Control'>Adding Items to ListView Control</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>Structures are a group of data elements, and we can access them using the structures. The data elements can be from any types.</p>
<p>Sample of a structure</p>
<pre class="cpp"><span style="color: #0000ff;">struct</span> StructName
<span style="color: #000000;">&#123;</span>
    <span style="color: #0000ff;">int</span> i;
    <span style="color: #0000ff;">char</span> c;
<span style="color: #000000;">&#125;</span> obj1, obj2;</pre>
<p>So, a structure is declared with the "struct" keyword, then comes its name. Then, in the braces we declare the data elements. After the braces we write the names (object) we will use for using that structure, that objects are global. We end with a semicolon.</p>
<p>Instead of the global object, we can create other objects wherever we want.<br />
Here is an example of creating the object</p>
<pre class="cpp"><span style="color: #0000ff;">struct</span> StructName obj;</pre>
<p>And then, using its data elements</p>
<pre class="cpp">obj.<span style="color: #00eeff;">i</span>=<span style="color: #0000dd;">5</span>;
obj.<span style="color: #00eeff;">c</span>=<span style="color: #666666;">'a'</span>;</pre>
<p>We can create as many as we want objects from a structure.</p>


<br /><p>More Related Posts:<ol><li><a href='http://www.codeitwell.com/readwrite-registry-keys.html' rel='bookmark' title='Permanent Link: Read/Write Registry Keys'>Read/Write Registry Keys</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cpp.html' rel='bookmark' title='Permanent Link: Write To File In C++'>Write To File In C++</a></li>
<li><a href='http://www.codeitwell.com/adding-items-to-listview-control.html' rel='bookmark' title='Permanent Link: Adding Items to ListView Control'>Adding Items to ListView Control</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codeitwell.com/structures-in-c-cpp.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Functions in C++</title>
		<link>http://www.codeitwell.com/functions-in-cpp.html</link>
		<comments>http://www.codeitwell.com/functions-in-cpp.html#comments</comments>
		<pubDate>Mon, 14 Jul 2008 20:21:45 +0000</pubDate>
		<dc:creator>Shabbir</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://www.codeitwell.com/?p=34</guid>
		<description><![CDATA[Functions are pieces of code, that can be executed by calling from another function. You know that a common C++ application, must have one function, that functions is int main(). So there is a statement of a function return_type function_name(parameter1, parameter2,...) { // Statements } return_type, is the type that the function returns as a [...]


More Related Posts:<ol><li><a href='http://www.codeitwell.com/using-the-timer-class.html' rel='bookmark' title='Permanent Link: Using the Timer Class'>Using the Timer Class</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cs.html' rel='bookmark' title='Permanent Link: Write To File in C#'>Write To File in C#</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cpp.html' rel='bookmark' title='Permanent Link: Write To File In C++'>Write To File In C++</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>Functions are pieces of code, that can be executed by calling from another function. You know that a common C++ application, must have one function, that functions is int main().</p>
<p>So there is a statement of a function</p>
<p>return_type function_name(parameter1, parameter2,...)</p>
<p>{</p>
<p>// Statements</p>
<p>}</p>
<ul>
<li>return_type, is the type that the function returns as a result (eg. int, float, string,...). It can be void, if the function doesn't return anything.</li>
<li>function_name, is the identifier of the function, we can call the function using that identifier</li>
<li>parameters, values that we give to the function to make some operations with them</li>
<li>statements, the code in the function, it is surrounded by braces</li>
</ul>
<p>Example:</p>
<pre class="cpp"><span style="color: #339900;">#include </span>
&nbsp;
<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std;
&nbsp;
<span style="color: #0000ff;">int</span> sum<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">int</span> a, <span style="color: #0000ff;">int</span> b<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0000ff;">return</span> a+b;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0000ff;">int</span> x=<span style="color: #0000dd;">5</span>;
<span style="color: #0000ff;">int</span> y=<span style="color: #0000dd;">6</span>;
<span style="color: #0000ff;">int</span> z=sum<span style="color: #000000;">&#40;</span>x, y<span style="color: #000000;">&#41;</span>;
<span style="color: #0000dd;">cout</span> &amp;lt;&amp;lt; z &amp;lt;&amp;lt; endl;
<span style="color: #000000;">&#125;</span></pre>
<p>The function expects two arguments, the first will be the value of x, the second will be the value of y. And it will return their sum.</p>
<p>So, we initialize two variables, x and y. And the variable z will get the value of the sum of x and y. That operation is performed by the function.</p>


<br /><p>More Related Posts:<ol><li><a href='http://www.codeitwell.com/using-the-timer-class.html' rel='bookmark' title='Permanent Link: Using the Timer Class'>Using the Timer Class</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cs.html' rel='bookmark' title='Permanent Link: Write To File in C#'>Write To File in C#</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cpp.html' rel='bookmark' title='Permanent Link: Write To File In C++'>Write To File In C++</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codeitwell.com/functions-in-cpp.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Read From File In C++</title>
		<link>http://www.codeitwell.com/read-from-file-in-cpp.html</link>
		<comments>http://www.codeitwell.com/read-from-file-in-cpp.html#comments</comments>
		<pubDate>Sat, 07 Jun 2008 20:25:32 +0000</pubDate>
		<dc:creator>Shabbir</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[C]]></category>

		<guid isPermaLink="false">http://www.codeitwell.com/?p=32</guid>
		<description><![CDATA[In the previous tutorial we explained how to do that in C#, now we will do that in C++. So, create a Win32 C++ Console Application. This tutorial will be similar to the tutorial for writing to file in c++, So, write this code &#160; int main&#40;&#41; &#123; ifstream in; in.open&#40;&#34;text.txt&#34;&#41;; &#160; char line&#91;256&#93;; &#160; [...]


More Related Posts:<ol><li><a href='http://www.codeitwell.com/read-from-file-using-streamreader-class.html' rel='bookmark' title='Permanent Link: Read From File Using StreamReader Class'>Read From File Using StreamReader Class</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cpp.html' rel='bookmark' title='Permanent Link: Write To File In C++'>Write To File In C++</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cs.html' rel='bookmark' title='Permanent Link: Write To File in C#'>Write To File in C#</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>In the <a href="http://www.codeitwell.com/read-from-file-using-streamreader-class.html">previous tutorial</a> we explained how to do that in C#, now we will do that in C++.<br />
So, create a Win32 C++ Console Application. This tutorial will be similar to the tutorial for <a href="http://www.codeitwell.com/write-to-file-in-cpp.html">writing to file in c++</a>,<br />
So, write this code</p>
<pre class="cpp">&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	ifstream in;
	in.<span style="color: #00eeff;">open</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;text.txt&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #0000ff;">char</span> line<span style="color: #000000;">&#91;</span><span style="color: #0000dd;">256</span><span style="color: #000000;">&#93;</span>;
&nbsp;
	<span style="color: #0000ff;">while</span><span style="color: #000000;">&#40;</span>in.<span style="color: #00eeff;">getline</span><span style="color: #000000;">&#40;</span>line, <span style="color: #0000dd;">256</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #0000dd;">cout</span> &amp;lt;&amp;lt; line &amp;lt;&amp;lt; endl;
&nbsp;
	in.<span style="color: #00eeff;">close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre>
<p>Here we read the file line by line, and write its content to the console.<br />
We have one char variable where we will store that lines, it will be long 256 characters. We are using the ifstream class, and creating an object from it, opening the file, do our work, and in the end we are closing the handle from our application to the file we read.<br />
That's it. Very simple.</p>


<br /><p>More Related Posts:<ol><li><a href='http://www.codeitwell.com/read-from-file-using-streamreader-class.html' rel='bookmark' title='Permanent Link: Read From File Using StreamReader Class'>Read From File Using StreamReader Class</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cpp.html' rel='bookmark' title='Permanent Link: Write To File In C++'>Write To File In C++</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cs.html' rel='bookmark' title='Permanent Link: Write To File in C#'>Write To File in C#</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codeitwell.com/read-from-file-in-cpp.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>C/C++ Trigraphs and Digraphs</title>
		<link>http://www.codeitwell.com/c-cpp-trigraphs-and-digraphs.html</link>
		<comments>http://www.codeitwell.com/c-cpp-trigraphs-and-digraphs.html#comments</comments>
		<pubDate>Mon, 19 May 2008 20:48:13 +0000</pubDate>
		<dc:creator>Shabbir</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[C]]></category>

		<guid isPermaLink="false">http://www.codeitwell.com/?p=29</guid>
		<description><![CDATA[Trigraph is a sequence of three characters. The first two always are question marks "??". Trigraphs are equivalent to some single characters. Here is a table from trigraphs and their equivalents Trigraph Equivalent ??! &#124; ??&#60; { ??&#62; } ??/ \ ??' ^ ??- ~ ??= # ??( [ ??) ] This can cause some [...]


More Related Posts:<ol><li><a href='http://www.codeitwell.com/read-from-file-in-cpp.html' rel='bookmark' title='Permanent Link: Read From File In C++'>Read From File In C++</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cpp.html' rel='bookmark' title='Permanent Link: Write To File In C++'>Write To File In C++</a></li>
<li><a href='http://www.codeitwell.com/how-java-virtual-machine-jvm-works.html' rel='bookmark' title='Permanent Link: How Java Virtual Machine (JVM) Works'>How Java Virtual Machine (JVM) Works</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>Trigraph is a sequence of three characters. The first two always are question marks "??".<br />
Trigraphs are equivalent to some single characters. Here is a table from trigraphs and their equivalents</p>
<table id="table1" border="1" width="100%">
<tbody>
<tr>
<td>
<p align="center"><strong>Trigraph</strong></p>
</td>
<td>
<p align="center"><strong>Equivalent</strong></p>
</td>
</tr>
<tr>
<td>
<p align="center">??!</p>
</td>
<td>
<p align="center">|</p>
</td>
</tr>
<tr>
<td>
<p align="center">??&lt;</p>
</td>
<td>
<p align="center">{</p>
</td>
</tr>
<tr>
<td>
<p align="center">??&gt;</p>
</td>
<td>
<p align="center">}</p>
</td>
</tr>
<tr>
<td>
<p align="center">??/</p>
</td>
<td>
<p align="center">\</p>
</td>
</tr>
<tr>
<td>
<p align="center">??'</p>
</td>
<td>
<p align="center">^</p>
</td>
</tr>
<tr>
<td>
<p align="center">??-</p>
</td>
<td>
<p align="center">~</p>
</td>
</tr>
<tr>
<td>
<p align="center">??=</p>
</td>
<td>
<p align="center">#</p>
</td>
</tr>
<tr>
<td>
<p align="center">??(</p>
</td>
<td>
<p align="center">[</p>
</td>
</tr>
<tr>
<td>
<p align="center">??)</p>
</td>
<td>
<p align="center">]</p>
</td>
</tr>
</tbody>
</table>
<p>This can cause some problems for new programmers. See this example</p>
<pre class="csharp"><span style="color: #008080; font-style: italic;">// This will be executed???????????/</span>
i++;</pre>
<p>This line of code will not be executed, because is used a trigraph "??/" the compiler will not compile the line.</p>
<p>Digraphs are used for the same issues as the trigraphs, see the digraphs</p>
<table id="table1" border="1" width="100%">
<tbody>
<tr>
<td>
<p align="center"><strong>Digraph</strong></p>
</td>
<td>
<p align="center"><strong>Equivalent</strong></p>
</td>
</tr>
<tr>
<td>
<p align="center">&lt;:</p>
</td>
<td>
<p align="center">[</p>
</td>
</tr>
<tr>
<td>
<p align="center">:&gt;</p>
</td>
<td>
<p align="center">]</p>
</td>
</tr>
<tr>
<td>
<p align="center">&lt;%</p>
</td>
<td>
<p align="center">{</p>
</td>
</tr>
<tr>
<td>
<p align="center">%&gt;</p>
</td>
<td>
<p align="center">}</p>
</td>
</tr>
<tr>
<td>
<p align="center">%:</p>
</td>
<td>
<p align="center">#</p>
</td>
</tr>
<tr>
<td>
<p align="center">%:%:</p>
</td>
<td>
<p align="center">##</p>
</td>
</tr>
</tbody>
</table>


<br /><p>More Related Posts:<ol><li><a href='http://www.codeitwell.com/read-from-file-in-cpp.html' rel='bookmark' title='Permanent Link: Read From File In C++'>Read From File In C++</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cpp.html' rel='bookmark' title='Permanent Link: Write To File In C++'>Write To File In C++</a></li>
<li><a href='http://www.codeitwell.com/how-java-virtual-machine-jvm-works.html' rel='bookmark' title='Permanent Link: How Java Virtual Machine (JVM) Works'>How Java Virtual Machine (JVM) Works</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codeitwell.com/c-cpp-trigraphs-and-digraphs.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pointers and Arrays</title>
		<link>http://www.codeitwell.com/pointers-and-arrays.html</link>
		<comments>http://www.codeitwell.com/pointers-and-arrays.html#comments</comments>
		<pubDate>Tue, 06 May 2008 17:20:58 +0000</pubDate>
		<dc:creator>Shabbir</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[C]]></category>

		<guid isPermaLink="false">http://www.codeitwell.com/?p=22</guid>
		<description><![CDATA[In this article we will explain moving the pointer through an array. It's simple but sometimes confusing. So try these simple examples in your unmanaged C++ project. Creating an array and assigning a pointer to it int arr&#91;4&#93;; int *ptr = arr; //[*][ ][ ][ ] Points at the first element of the array When [...]


More Related Posts:<ol><li><a href='http://www.codeitwell.com/pointers.html' rel='bookmark' title='Permanent Link: Pointers'>Pointers</a></li>
<li><a href='http://www.codeitwell.com/read-from-file-in-cpp.html' rel='bookmark' title='Permanent Link: Read From File In C++'>Read From File In C++</a></li>
<li><a href='http://www.codeitwell.com/functions-in-cpp.html' rel='bookmark' title='Permanent Link: Functions in C++'>Functions in C++</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>In this article we will explain moving the pointer through an array. It's simple but sometimes confusing.<br />
So try these simple examples in your unmanaged C++ project.</p>
<p>Creating an array and assigning a pointer to it</p>
<pre class="cpp"><span style="color: #0000ff;">int</span> arr<span style="color: #000000;">&#91;</span><span style="color: #0000dd;">4</span><span style="color: #000000;">&#93;</span>;
<span style="color: #0000ff;">int</span> *ptr = arr;  <span style="color: #ff0000;">//[*][ ][ ][ ] Points at the first element of the array</span></pre>
<p>When using pointers and arrays, we don't need to use ampersand (&) to assign the address of the array to the pointer. It returns the address of the first array element. But if we want to point at other element (not the first) we must use an ampersand.</p>
<p>Then we assign a value to the first element</p>
<pre class="cpp">*ptr = <span style="color: #0000dd;">2</span>;        <span style="color: #ff0000;">//1st</span></pre>
<p>Moving the pointer two places forward (his address will increase by the size of integer which is 4 bytes, in this case 2x4), now the pointer points at the third element, and we assign a value to it (6)</p>
<pre class="cpp">ptr += <span style="color: #0000dd;">2</span>;        <span style="color: #ff0000;">//[ ][ ][*][ ]</span>
*ptr = <span style="color: #0000dd;">6</span>;        <span style="color: #ff0000;">//3rd</span></pre>
<p>Other way to point to an element, the way with ampersand. We now point at the last element, the fourth, and assigning a value to it (8)</p>
<pre class="cpp">ptr=&amp;arr<span style="color: #000000;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #000000;">&#93;</span>;     <span style="color: #ff0000;">//[ ][ ][ ][*]</span>
*ptr=<span style="color: #0000dd;">8</span>;          <span style="color: #ff0000;">//4th</span></pre>
<p>Not moving the pointer but pointing two places left from the pointer, and then assigning a value</p>
<pre class="cpp">*<span style="color: #000000;">&#40;</span>ptr - <span style="color: #0000dd;">2</span><span style="color: #000000;">&#41;</span> = <span style="color: #0000dd;">4</span>;  <span style="color: #ff0000;">//2nd</span></pre>
<p>Print the value which ptr points on</p>
<pre class="cpp"><span style="color: #0000dd;">cout</span> &lt;&lt; *ptr &lt;&lt; endl;</pre>
<p>It will be printed "8", that shows that the pointer points to the last element.</p>
<p>Now print the array</p>
<pre class="cpp"><span style="color: #0000ff;">for</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">int</span> i = <span style="color: #0000dd;">0</span> ;i &lt; <span style="color: #0000dd;">4</span> ;i++<span style="color: #000000;">&#41;</span>
	<span style="color: #0000dd;">cout</span> &lt;&lt; arr<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span> &lt;&lt; endl;</pre>
<p>Printed values: 2, 4, 6, 8.</p>
<p>Let's see how to print using the pointer without moving it, but first, make the pointer point on the first element</p>
<pre class="cpp">ptr = arr;</pre>
<p>then</p>
<pre class="cpp"><span style="color: #0000ff;">for</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">int</span> i = <span style="color: #0000dd;">0</span> ;i &lt; <span style="color: #0000dd;">4</span> ;i++<span style="color: #000000;">&#41;</span>
	<span style="color: #0000dd;">cout</span> &lt;&lt; *<span style="color: #000000;">&#40;</span>ptr + i<span style="color: #000000;">&#41;</span> &lt;&lt; endl;</pre>
<p>or printing by moving the pointer</p>
<pre class="cpp"><span style="color: #0000ff;">for</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">int</span> i = <span style="color: #0000dd;">0</span> ;i &lt; <span style="color: #0000dd;">4</span> ;i++<span style="color: #000000;">&#41;</span>
	<span style="color: #0000dd;">cout</span> &lt;&lt; *ptr++ &lt;&lt; endl;</pre>


<br /><p>More Related Posts:<ol><li><a href='http://www.codeitwell.com/pointers.html' rel='bookmark' title='Permanent Link: Pointers'>Pointers</a></li>
<li><a href='http://www.codeitwell.com/read-from-file-in-cpp.html' rel='bookmark' title='Permanent Link: Read From File In C++'>Read From File In C++</a></li>
<li><a href='http://www.codeitwell.com/functions-in-cpp.html' rel='bookmark' title='Permanent Link: Functions in C++'>Functions in C++</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codeitwell.com/pointers-and-arrays.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pointers</title>
		<link>http://www.codeitwell.com/pointers.html</link>
		<comments>http://www.codeitwell.com/pointers.html#comments</comments>
		<pubDate>Sat, 03 May 2008 21:34:47 +0000</pubDate>
		<dc:creator>Shabbir</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.codeitwell.com/?p=20</guid>
		<description><![CDATA[Pointers are one of the hardest parts of programming to understand. But they are very useful. When programming with pointers, we use two operators: reference operator (&#038;) and dereference operator (*). We use the reference operator to see the address where a variable is stored, and the dereference operator is to see the value of [...]


More Related Posts:<ol><li><a href='http://www.codeitwell.com/pointers-and-arrays.html' rel='bookmark' title='Permanent Link: Pointers and Arrays'>Pointers and Arrays</a></li>
<li><a href='http://www.codeitwell.com/increment-and-decrement-operators.html' rel='bookmark' title='Permanent Link: Increment and Decrement Operators'>Increment and Decrement Operators</a></li>
<li><a href='http://www.codeitwell.com/functions-in-cpp.html' rel='bookmark' title='Permanent Link: Functions in C++'>Functions in C++</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>Pointers are one of the hardest parts of programming to understand. But they are very useful.<br />
When programming with pointers, we use two operators: reference operator (&) and dereference operator (*).<br />
We use the reference operator to see the address where a variable is stored, and the dereference operator is to see the value of a variable.</p>
<p>Example:
<pre class="cpp"><span style="color: #0000ff;">int</span> a = <span style="color: #0000dd;">10</span>;
<span style="color: #0000ff;">int</span> *ptr = &amp;a;
&nbsp;
<span style="color: #0000dd;">cout</span> &lt;&lt; ptr &lt;&lt; endl;       <span style="color: #ff0000;">//Will print the address of a in hex</span>
<span style="color: #0000dd;">cout</span> &lt;&lt; *ptr &lt;&lt; endl;      <span style="color: #ff0000;">//Will print the value of a (10)</span>
&nbsp;
<span style="color: #ff0000;">//ptr = a;      This is wrong</span></pre>
<p>Now, the addres of the variable a is stored in ptr, this means that ptr shows on a. According to this we can change the value of a using ptr.</p>
<p>See this example:
<pre class="cpp">*ptr = <span style="color: #0000dd;">20</span>;
<span style="color: #0000dd;">cout</span> &lt;&lt; a &lt;&lt; endl;      <span style="color: #ff0000;">//Will print 20</span></pre>
<p style="text-align: center;"><img src='http://www.codeitwell.com/wp-content/images/19.1.gif' alt='Pointers and variables in memory' class='alignnone' /></p>
<p>As you see on the picture, the variable a is stored on the memory location 0002 with its value 10, and ptr is stored on the memory location 0005 and its value is the address of variable a (0002). This explains the above example.</p>
<p>In one the next articles we will explain using pointers with arrays, so stay tuned.</p>


<br /><p>More Related Posts:<ol><li><a href='http://www.codeitwell.com/pointers-and-arrays.html' rel='bookmark' title='Permanent Link: Pointers and Arrays'>Pointers and Arrays</a></li>
<li><a href='http://www.codeitwell.com/increment-and-decrement-operators.html' rel='bookmark' title='Permanent Link: Increment and Decrement Operators'>Increment and Decrement Operators</a></li>
<li><a href='http://www.codeitwell.com/functions-in-cpp.html' rel='bookmark' title='Permanent Link: Functions in C++'>Functions in C++</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codeitwell.com/pointers.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Write To File In C++</title>
		<link>http://www.codeitwell.com/write-to-file-in-cpp.html</link>
		<comments>http://www.codeitwell.com/write-to-file-in-cpp.html#comments</comments>
		<pubDate>Wed, 30 Apr 2008 20:52:52 +0000</pubDate>
		<dc:creator>Shabbir</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Write To File]]></category>

		<guid isPermaLink="false">http://www.codeitwell.com/?p=13</guid>
		<description><![CDATA[In this post we explained writing in a file using the C# language. In this post we will explain how to do that in unmanaged C++. So, we are creating a C++ console application, you can use Dev C++ for compiling this code. Here is the code. &#160; int main&#40;&#41; &#123; ofstream fw; fw.open&#40;&#34;text.txt&#34;&#41;; fw [...]


More Related Posts:<ol><li><a href='http://www.codeitwell.com/read-from-file-in-cpp.html' rel='bookmark' title='Permanent Link: Read From File In C++'>Read From File In C++</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cs.html' rel='bookmark' title='Permanent Link: Write To File in C#'>Write To File in C#</a></li>
<li><a href='http://www.codeitwell.com/read-from-file-using-streamreader-class.html' rel='bookmark' title='Permanent Link: Read From File Using StreamReader Class'>Read From File Using StreamReader Class</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>In <a title="Write to file c#" href="http://www.codeitwell.com/write-to-file-in-cs.html">this</a> post we explained writing in a file using the C# language. In this post we will explain how to do that in unmanaged C++.<br />
So, we are creating a C++ console application, you can use Dev C++ for compiling this code.<br />
Here is the code.</p>
<pre class="cpp">&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	ofstream fw;
	fw.<span style="color: #00eeff;">open</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;text.txt&quot;</span><span style="color: #000000;">&#41;</span>;
	fw &lt;&lt; <span style="color: #666666;">&quot;Some texxxxxxxxxt.&quot;</span> &lt;&lt; endl;
	fw &lt;&lt; <span style="color: #666666;">&quot;tab<span style="color: #666666; font-weight: bold;">\t</span>tab, and a new line<span style="color: #666666; font-weight: bold;">\n</span>....&quot;</span> &lt;&lt; endl;
<span style="color: #000000;">&#125;</span></pre>
<p>We include the fstream library, it contains the ofstream and ifstream classes. They are used for writting and reading to/from files.<br />
Then, in the main function we create an object from ofstream class, and with function open we tell the object that we will write in the file "text.txt".</p>
<p>We write some text to file (check the new line and tab characters).</p>
<p>In the end we close the handle.</p>
<p>This will be written in the file</p>
<pre>Some texxxxxxxxxt.
tab	tab, and a new line
....</pre>
<p>If you do not want to erase all text from the file and then write to it again, just make this change</p>
<pre class="cpp">fw.<span style="color: #00eeff;">open</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;text.txt&quot;</span>, ios::<span style="color: #00eeff;">app</span><span style="color: #000000;">&#41;</span>;</pre>


<br /><p>More Related Posts:<ol><li><a href='http://www.codeitwell.com/read-from-file-in-cpp.html' rel='bookmark' title='Permanent Link: Read From File In C++'>Read From File In C++</a></li>
<li><a href='http://www.codeitwell.com/write-to-file-in-cs.html' rel='bookmark' title='Permanent Link: Write To File in C#'>Write To File in C#</a></li>
<li><a href='http://www.codeitwell.com/read-from-file-using-streamreader-class.html' rel='bookmark' title='Permanent Link: Read From File Using StreamReader Class'>Read From File Using StreamReader Class</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codeitwell.com/write-to-file-in-cpp.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Increment and Decrement Operators</title>
		<link>http://www.codeitwell.com/increment-and-decrement-operators.html</link>
		<comments>http://www.codeitwell.com/increment-and-decrement-operators.html#comments</comments>
		<pubDate>Sun, 27 Apr 2008 20:43:40 +0000</pubDate>
		<dc:creator>Shabbir</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[C]]></category>

		<guid isPermaLink="false">http://www.codeitwell.com/?p=10</guid>
		<description><![CDATA[Very common programming practice is adding or subtracting an integer variable by 1. We know that adding 1 to variable is incrementing, and subtract 1 from variable is decrementing. It only works with integer values. Let us see some examples i++; i=i+1; i+=1; This three commands are all the same. It increments the variable i [...]


More Related Posts:<ol><li><a href='http://www.codeitwell.com/how-some-of-the-programming-languages-are-named.html' rel='bookmark' title='Permanent Link: How some of the programming languages are named'>How some of the programming languages are named</a></li>
<li><a href='http://www.codeitwell.com/pointers.html' rel='bookmark' title='Permanent Link: Pointers'>Pointers</a></li>
<li><a href='http://www.codeitwell.com/pointers-and-arrays.html' rel='bookmark' title='Permanent Link: Pointers and Arrays'>Pointers and Arrays</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p></p><p>Very common programming practice is adding or subtracting an integer variable by 1.</p>
<p>We know that adding 1 to variable is incrementing, and subtract 1 from variable is decrementing. It only works with integer values.</p>
<p>Let us see some examples</p>
<pre class="cpp">i++;
i=i<span style="color: #0000dd;">+1</span>;
i+=<span style="color: #0000dd;">1</span>;</pre>
<p>This three commands are all the same. It increments the variable i by 1. Its the same for decrementing.</p>
<p>The incrementation and decrementation can be made with prefix of postfix</p>
<pre class="cpp">i++;    <span style="color: #ff0000;">//postfix</span>
++i;    <span style="color: #ff0000;">//prefix</span></pre>
<p>Here are some examples of using prefix and postfix</p>
<pre class="cpp"><span style="color: #0000ff;">int</span> j=++i;        <span style="color: #ff0000;">//1</span>
<span style="color: #0000ff;">int</span> j=i--;        <span style="color: #ff0000;">//2</span></pre>
<p>The above commands are equal to this</p>
<pre class="cpp">i++;             <span style="color: #ff0000;">//1</span>
<span style="color: #0000ff;">int</span> j=i;
&nbsp;
<span style="color: #0000ff;">int</span> j=i;         <span style="color: #ff0000;">//2</span>
i--;</pre>
<p>or</p>
<pre class="cpp">i=i<span style="color: #0000dd;">+1</span>;             <span style="color: #ff0000;">//1</span>
<span style="color: #0000ff;">int</span> j=i;
&nbsp;
<span style="color: #0000ff;">int</span> j=i;           <span style="color: #ff0000;">//2</span>
i=i<span style="color: #0000dd;">-1</span>;</pre>
<p>This operators are used in many programming languages, and are very simple for using.<br />
As we know C++ is one lever above C, so, maybe the postfix was the inspiration for Bjarne Stroustrup to name the new programming language to C++ in 1979.</p>


<br /><p>More Related Posts:<ol><li><a href='http://www.codeitwell.com/how-some-of-the-programming-languages-are-named.html' rel='bookmark' title='Permanent Link: How some of the programming languages are named'>How some of the programming languages are named</a></li>
<li><a href='http://www.codeitwell.com/pointers.html' rel='bookmark' title='Permanent Link: Pointers'>Pointers</a></li>
<li><a href='http://www.codeitwell.com/pointers-and-arrays.html' rel='bookmark' title='Permanent Link: Pointers and Arrays'>Pointers and Arrays</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.codeitwell.com/increment-and-decrement-operators.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

