





<?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>Durofy &#187; Programming</title>
	<atom:link href="http://www.durofy.com/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.durofy.com</link>
	<description>Engineering &#38; Technology Blog</description>
	<lastBuildDate>Sun, 05 Feb 2012 04:41:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>[C Tutorial 1] Introduction to Programming</title>
		<link>http://www.durofy.com/programming/tutorial-1-introduction-to-programming/</link>
		<comments>http://www.durofy.com/programming/tutorial-1-introduction-to-programming/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 18:40:09 +0000</pubDate>
		<dc:creator>Rishabh Dev</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c compiler]]></category>
		<category><![CDATA[c programming example]]></category>
		<category><![CDATA[c programming tutotrial]]></category>
		<category><![CDATA[c sample program]]></category>
		<category><![CDATA[c++ program]]></category>
		<category><![CDATA[c++ programming]]></category>
		<category><![CDATA[compiler]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[programming basics]]></category>

		<guid isPermaLink="false">http://www.zarrata.com/cprogramming/?p=4</guid>
		<description><![CDATA[In these tutorials, we're not really getting into the whos &#038; whens - our one and only aim is to write efficient programs in C. For everything else - there's Google. Now, you could be here either to pass an exam - get a degree or you could be here for the love of code [...]]]></description>
			<content:encoded><![CDATA[<p>In these tutorials, we're not really getting into the whos &#038; whens - our one and only aim is to write efficient programs in C. For everything else - there's Google.</p>
<p>Now, you could be here either to pass an exam - get a degree or you could be here for the love of code - to make something new. Make sure your's is the second reason. If not, make it so.</p>
<p><strong>What is a Program? Why do we need to program at all?</strong></p>
<p>Some people wonder(believe me, they do) - what's with this code stuff.. why do we really need to write a program at all? The answer is simple - even simpler if you know how a computer works. A computer or any electronic system for that matter, is made of a large number of switches or gates -  When a certain combination of gates is created - an operation is performed. This combination is made by opening and closing appropriate switches.</p>
<p>Since a computer doesn't have a mind of its own - we need to give instructions to the computer in order to close and open the switches. This set of instructions is called a program. A program is essentially a blueprint for this combination.</p>
<p><strong>What is a Compiler? Which compiler should be used for C?</strong></p>
<p>Since our computer only understands binary - we need a "program" to translate the code written by us in a programming language of our choice - to binary. This program is called the compiler. The programs written by us are a "higher-level" (user-friendly or rather human-friendly) than what the computer understands.</p>
<p>You can download any of the C compilers available for free. Try Dev C++ <a href="http://prdownloads.sourceforge.net/dev-cpp/devcpp-4.9.9.2_setup.exe">(Download Link)</a> or Code::Blocks <a href="http://sourceforge.net/projects/codeblocks/files/Binaries/10.05/Windows/codeblocks-10.05-setup.exe">(Download Link)</a> to start with - and you can later switch to a compiler of your choice. A list of all the C compilers is available <a href="http://en.wikipedia.org/wiki/List_of_compilers#C_compilers">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.durofy.com/programming/tutorial-1-introduction-to-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding Inheritance in OOP</title>
		<link>http://www.durofy.com/programming/understanding-inheritance-in-oop/</link>
		<comments>http://www.durofy.com/programming/understanding-inheritance-in-oop/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 06:45:56 +0000</pubDate>
		<dc:creator>Rishabh Dev</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c sample program]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[c++ inheritance]]></category>
		<category><![CDATA[c++ programming]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[derived classes oop]]></category>
		<category><![CDATA[inheritance]]></category>
		<category><![CDATA[inheritance c++]]></category>
		<category><![CDATA[inheritance concept]]></category>
		<category><![CDATA[object-oriented programming]]></category>
		<category><![CDATA[oop inheritance]]></category>

		<guid isPermaLink="false">http://zarrata.com/durofy/?p=168</guid>
		<description><![CDATA[The example below explains inheritance, an important property of OOP languages. We have three classes: living, animal &#38; dog. The dog inherits all the characteristics of living &#38; animal base classes however, the plant does not(being an instance of just the living class). #include&#60;iostream&#62; using namespace std; class living { int energy; public: void getenergy() [...]]]></description>
			<content:encoded><![CDATA[<p>The example below explains inheritance, an important property of OOP languages.</p>
<p>We have three classes: living, animal &amp; dog. The dog inherits all the characteristics of living &amp; animal base classes however, the plant does not(being an instance of just the living class).</p>
<pre>#include<span style="color: blue; font-size: xx-small;">&lt;</span>iostream<span style="color: blue; font-size: xx-small;">&gt;</span>
using namespace std<span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
<span style="color: red;"><strong>class</strong></span> living
<span style="color: blue; font-size: xx-small;"><strong>{</strong></span>
      <span style="color: red;"><strong>int</strong></span> energy<span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
      <span style="color: red;"><strong>public</strong></span><span style="color: blue; font-size: xx-small;">:</span>
                <span style="color: red;"><strong>void</strong></span> getenergy<span style="color: blue; font-size: xx-small;"><strong>(</strong></span><span style="color: blue; font-size: xx-small;"><strong>)</strong></span>
                <span style="color: blue; font-size: xx-small;"><strong>{</strong></span>
                     cout<span style="color: blue; font-size: xx-small;">&lt;</span><span style="color: blue; font-size: xx-small;">&lt;</span><span style="color: purple;">"Gets energy"</span><span style="color: blue; font-size: xx-small;">&lt;</span><span style="color: blue; font-size: xx-small;">&lt;</span>endl<span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
                     <span style="color: blue; font-size: xx-small;"><strong>}</strong></span>
<span style="color: blue; font-size: xx-small;"><strong>}</strong></span><span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
<span style="color: red;"><strong>class</strong></span> animal<span style="color: blue; font-size: xx-small;">:</span><span style="color: red;"><strong>public</strong></span> living
<span style="color: blue; font-size: xx-small;"><strong>{</strong></span>
      <span style="color: red;"><strong>int</strong></span> feet<span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
      <span style="color: red;"><strong>public</strong></span><span style="color: blue; font-size: xx-small;">:</span>
                <span style="color: red;"><strong>void</strong></span> move<span style="color: blue; font-size: xx-small;"><strong>(</strong></span><span style="color: blue; font-size: xx-small;"><strong>)</strong></span>
                <span style="color: blue; font-size: xx-small;"><strong>{</strong></span>
                     cout<span style="color: blue; font-size: xx-small;">&lt;</span><span style="color: blue; font-size: xx-small;">&lt;</span><span style="color: purple;">"It moves"</span><span style="color: blue; font-size: xx-small;">&lt;</span><span style="color: blue; font-size: xx-small;">&lt;</span>endl<span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
                     <span style="color: blue; font-size: xx-small;"><strong>}</strong></span>
<span style="color: blue; font-size: xx-small;"><strong>}</strong></span><span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
<span style="color: red;"><strong>class</strong></span> dog<span style="color: blue; font-size: xx-small;">:</span><span style="color: red;"><strong>public</strong></span> animal
<span style="color: blue; font-size: xx-small;"><strong>{</strong></span>

      <span style="color: red;"><strong>int</strong></span> tail<span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
      <span style="color: red;"><strong>public</strong></span><span style="color: blue; font-size: xx-small;">:</span>
                <span style="color: red;"><strong>void</strong></span> bark<span style="color: blue; font-size: xx-small;"><strong>(</strong></span><span style="color: blue; font-size: xx-small;"><strong>)</strong></span>
                <span style="color: blue; font-size: xx-small;"><strong>{</strong></span>
                     cout<span style="color: blue; font-size: xx-small;">&lt;</span><span style="color: blue; font-size: xx-small;">&lt;</span><span style="color: purple;">"It barks"</span><span style="color: blue; font-size: xx-small;">&lt;</span><span style="color: blue; font-size: xx-small;">&lt;</span>endl<span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
                     <span style="color: blue; font-size: xx-small;"><strong>}</strong></span>
<span style="color: blue; font-size: xx-small;"><strong>}</strong></span><span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
<span style="color: red;"><strong>int</strong></span> <span style="color: red;"><strong>main</strong></span><span style="color: blue; font-size: xx-small;"><strong>(</strong></span><span style="color: blue; font-size: xx-small;"><strong>)</strong></span>
<span style="color: blue; font-size: xx-small;"><strong>{</strong></span>
    living plant<span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
    plant<span style="color: blue; font-size: xx-small;"><strong>.</strong></span>getenergy<span style="color: blue; font-size: xx-small;"><strong>(</strong></span><span style="color: blue; font-size: xx-small;"><strong>)</strong></span><span style="color: blue; font-size: xx-small;"><strong>;</strong></span>

    dog phoenix<span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
    phoenix<span style="color: blue; font-size: xx-small;"><strong>.</strong></span>getenergy<span style="color: blue; font-size: xx-small;"><strong>(</strong></span><span style="color: blue; font-size: xx-small;"><strong>)</strong></span><span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
    phoenix<span style="color: blue; font-size: xx-small;"><strong>.</strong></span>move<span style="color: blue; font-size: xx-small;"><strong>(</strong></span><span style="color: blue; font-size: xx-small;"><strong>)</strong></span><span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
    phoenix<span style="color: blue; font-size: xx-small;"><strong>.</strong></span>bark<span style="color: blue; font-size: xx-small;"><strong>(</strong></span><span style="color: blue; font-size: xx-small;"><strong>)</strong></span><span style="color: blue; font-size: xx-small;"><strong>;</strong></span>

    system<span style="color: blue; font-size: xx-small;"><strong>(</strong></span><span style="color: purple;">"pause"</span><span style="color: blue; font-size: xx-small;"><strong>)</strong></span><span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
    <span style="color: red;"><strong>return</strong></span> <span style="color: #a52a2a;">0</span><span style="color: blue; font-size: xx-small;"><strong>;</strong></span>
<span style="color: blue; font-size: xx-small;"><strong>}</strong></span></pre>
<p>The dog inherits the properties of animal which inherits the properties of living. Hence, this inheritance is an example of "Multi-level" inheritance.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.durofy.com/programming/understanding-inheritance-in-oop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Major Differences Between C And C++</title>
		<link>http://www.durofy.com/programming/10-major-differences-between-c-and-c/</link>
		<comments>http://www.durofy.com/programming/10-major-differences-between-c-and-c/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 17:23:23 +0000</pubDate>
		<dc:creator>Rishabh Dev</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[10 differences c c++]]></category>
		<category><![CDATA[c c++ difference]]></category>
		<category><![CDATA[c vs c++]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[c++ programming]]></category>
		<category><![CDATA[differences between c and c++]]></category>
		<category><![CDATA[main difference c c++]]></category>
		<category><![CDATA[major differences c and c++]]></category>
		<category><![CDATA[object-oriented programming]]></category>
		<category><![CDATA[procedural programming]]></category>

		<guid isPermaLink="false">http://zarrata.com/durofy/?p=81</guid>
		<description><![CDATA[&#160; C++, as the name suggests is a superset of C. As a matter of fact, C++ can run most of C code while C cannot run C++ code. Here are the 10 major differences between C++ &#38; C... 1. C follows the procedural programming paradigm while C++ is a multi-paradigm language(procedural as well as [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>C++, as the name suggests is a superset of C. As a matter of fact, C++ can run most of C code while C cannot run C++ code. Here are the 10 major differences between C++ &amp; C...</p>
<p>1. C follows the procedural programming paradigm while C++ is a <a href="http://zarrata.com/durofy/programming/c-as-a-multi-paradigm-programming-language/">multi-paradigm</a> language(procedural as well as object oriented)</p>
<blockquote><p>In case of C, importance is given to the steps or procedure of the program while C++ focuses on the data rather than the process.<br />
Also, it is easier to implement/edit the code in case of C++ for the same reason.</p></blockquote>
<p>2. In case of C, the data is not secured while the data is secured(hidden) in C++</p>
<blockquote><p>This difference is due to specific <a href="http://zarrata.com/durofy/programming/the-basics-of-object-oriented-programming/">OOP features</a> like Data Hiding which are not present in C.</p></blockquote>
<p>3. C is a low-level language while C++ is a middle-level language (Relatively, Please see the discussion at the end of the post)</p>
<blockquote><p>C is regarded as a low-level language(difficult interpretation &amp; less user friendly) while C++ has features of both low-level(concentration on whats going on in the machine hardware) &amp; high-level languages(concentration on the program itself) &amp; hence is regarded as a middle-level language.</p></blockquote>
<p>4. C uses the top-down approach while C++ uses the bottom-up approach</p>
<blockquote><p>In case of C, the program is formulated step by step, each step is processed into detail while in C++, the base elements are first formulated which then are linked together to give rise to larger systems.</p></blockquote>
<p>5. C is function-driven while C++ is object-driven</p>
<blockquote><p>Functions are the building blocks of a C program while objects are building blocks of a C++ program.</p></blockquote>
<p>6. C++ supports function overloading while C does not</p>
<blockquote><p>Overloading means two functions having the same name in the same program. This can be done only in C++ with the help of <a href="http://zarrata.com/durofy/programming/the-basics-of-object-oriented-programming/">Polymorphism</a>(an OOP feature)</p></blockquote>
<p>7. We can use functions inside structures in C++ but not in C.</p>
<blockquote><p>In case of C++, functions can be used inside a structure while structures cannot contain functions in C.</p></blockquote>
<p>8. The NAMESPACE feature in C++ is absent in case of C</p>
<blockquote><p>C++ uses NAMESPACE which avoid name collisions. For instance, two students enrolled in the same university cannot have the same roll number while two students in different universities might have the same roll number. The universities are two different namespace &amp; hence contain the same roll number(identifier) but the same university(one namespace) cannot have two students with the same roll number(identifier)</p></blockquote>
<p>9. The standard input &amp; output functions differ in the two languages</p>
<blockquote><p>C uses scanf &amp; printf while C++ uses cin&gt;&gt; &amp; cout&lt;&lt; as their respective input &amp; output functions</p></blockquote>
<p>10. C++ allows the use of reference variables while C does not</p>
<blockquote><p>Reference variables allow two variable names to point to the same memory location. We cannot use these variables in C programming.</p></blockquote>
<hr />
<p>Don't forget to check out :</p>
<ul>
<li><strong><a href="http://zarrata.com/durofy/programming/10-major-differences-between-c-and-java/">10 Major Differences Between C And JAVA</a></strong></li>
<li><strong><a href="http://zarrata.com/durofy/tutorials/c-programming-tutorials/">C programming Tutorials</a></strong></li>
<li><strong><a href="http://zarrata.com/durofy/tutorials/cplusplus-programming-tutorials/">C++ Programming Tutorials</a></strong></li>
</ul>
<hr />
<p><strong>MORE -</strong></p>
<p>11. C++ supports Exception Handling while C does not.</p>
<blockquote><p>C does not support it "formally" but it can always be implemented by other methods. Though you don't have the framework to throw &amp; catch exceptions as in C++.</p></blockquote>
<p>(will add more..)</p>
<hr />
<p><strong>UPDATES (ref to comments)-</strong></p>
<p><strong>Praveen</strong> - some of them r telling ‘C’ is a middle level language…..tell me the correct type of level language….?</p>
<p><strong>Answer-@praveen</strong> – I agree there are always mixed opinions about this one. Some even like to call it a high-level language. But there’s really no determining factor behind the level of a programming language. Essentially, we’re making all the changes at the machine level, right? Now, as we increase the abstraction and move away from the machine-level, the level of the language increases. So, the level is nothing but the level of abstraction. So, most of the languages we use in applications today will have aspects of both machine-level and user-level. The two levels are machine-level &amp; user(real world)-level while high &amp; low levels are relative terms. Although, C is on a lower level of abstraction “relatively”- when compared to C++. Hence, referred to here as low-level.</p>
<p><strong>Mitchell -</strong><br />
cin and cout are part of the std namespace, and they’re not functions. They’re almost like “pipes” in a sense. What you’re doing is essentially bit shifting (&lt;&gt; are bit shift operators) data into and out of them. As well, C++ still supports use of printf and scanf, so your std.cin and std.cout are by no means exclusive in their duties.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.durofy.com/programming/10-major-differences-between-c-and-c/feed/</wfw:commentRss>
		<slash:comments>176</slash:comments>
		</item>
	</channel>
</rss>

