<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4157222961107208557</id><updated>2011-04-21T13:13:20.308-07:00</updated><title type='text'>c/c++ Tutorials</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cfundas.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4157222961107208557/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://cfundas.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>chandana</name><uri>http://www.blogger.com/profile/01357047001736802270</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4157222961107208557.post-3613780961034439709</id><published>2007-12-31T23:45:00.000-08:00</published><updated>2007-12-31T23:46:40.847-08:00</updated><title type='text'>First C Program</title><content type='html'>&lt;span style="font-weight: bold;"&gt;  Let's be polite and start by saluting the world!  Type the following program into your favorite    &lt;/span&gt;&lt;span style="text-decoration: underline; font-weight: bold;"&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;:  &lt;/span&gt;&lt;pre style="font-weight: bold;"&gt;&lt;hr /&gt;&lt;br /&gt;#include &lt;&gt;&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;   printf("\nHello World\n");&lt;br /&gt;}&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-weight: bold;"&gt;  Save the code in the file &lt;/span&gt;&lt;kbd style="font-weight: bold;"&gt;hello.c&lt;/kbd&gt;&lt;span style="font-weight: bold;"&gt;, then  &lt;/span&gt;&lt;span style="text-decoration: underline; font-weight: bold;"&gt;compiles&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; it by typing:  &lt;/span&gt;&lt;pre style="font-weight: bold;"&gt; gcc hello.c&lt;br /&gt;&lt;/pre&gt;  &lt;p style="font-weight: bold;"&gt; This creates an &lt;i&gt;executable&lt;/i&gt; file &lt;kbd&gt;a.out&lt;/kbd&gt;, which is then executed simply by typing its name. The result is that the characters `` &lt;kbd&gt;Hello World&lt;/kbd&gt;'' are printed out, preceded by an empty line.  &lt;/p&gt;&lt;p style="font-weight: bold;"&gt; A C program contains &lt;i&gt;functions&lt;/i&gt; and &lt;i&gt;variables&lt;/i&gt;.  The functions specify the tasks to be performed by the program. The ``main'' function establishes the overall logic of the code. It is normally kept short and calls different functions to perform the necessary sub-tasks.  All C codes must have a ``main'' function.  &lt;/p&gt;&lt;p style="font-weight: bold;"&gt; Our &lt;kbd&gt;hello.c&lt;/kbd&gt; code calls &lt;kbd&gt;printf&lt;/kbd&gt;, an output function from the I/O (input/output) library (defined in the file &lt;kbd&gt;stdio.h&lt;/kbd&gt;). The original C language did not have any built-in I/O statements whatsoever.  Nor did it have much arithmetic functionality.  The original language was really not intended for ''scientific'' or ''technical'' computation..  These functions are now performed by standard libraries, which are now part of ANSI C. The K &amp;amp; R textbook lists the content of these and other standard libraries in an appendix.  &lt;/p&gt;&lt;p style="font-weight: bold;"&gt; The &lt;kbd&gt;printf&lt;/kbd&gt; line prints the message ``&lt;kbd&gt;Hello World&lt;/kbd&gt;'' on ``&lt;kbd&gt;stdout&lt;/kbd&gt;'' (the output stream corresponding to the X-terminal window in which you run the code); ``&lt;kbd&gt;\n&lt;/kbd&gt;'' prints a ``new line'' character, which brings the cursor onto the next line.  By construction, &lt;kbd&gt;printf&lt;/kbd&gt; never inserts this character on its own: the following program would produce the same result:  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4157222961107208557-3613780961034439709?l=cfundas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cfundas.blogspot.com/feeds/3613780961034439709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4157222961107208557&amp;postID=3613780961034439709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4157222961107208557/posts/default/3613780961034439709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4157222961107208557/posts/default/3613780961034439709'/><link rel='alternate' type='text/html' href='http://cfundas.blogspot.com/2007/12/first-c-program.html' title='First C Program'/><author><name>chandana</name><uri>http://www.blogger.com/profile/01357047001736802270</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4157222961107208557.post-7626321422533804370</id><published>2007-12-31T23:38:00.000-08:00</published><updated>2007-12-31T23:43:52.427-08:00</updated><title type='text'>C Introduction</title><content type='html'>&lt;span style="font-weight: bold;"&gt; C is a programming language of many different dialects, similar to the way that each spoken language has many different dialects. In C, dialects don't exist because the speakers live in the North or South.  Instead, they're there because there are many different compilers that support slightly different features. There are several common compilers:.  There are also many front-end environments for the different compilers--the most common is &lt;/span&gt;&lt;a style="font-weight: bold;" href="http://www.cprogramming.com/other.html"&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt; GNU's G++ compiler.  Some, such as GCC are free, while others are not. Please see the &lt;/span&gt;&lt;a style="font-weight: bold;" href="http://www.cprogramming.com/compilers.html"&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;for more information on how to get a compiler and  set it up.  You should note that if you are programming in C on a C++ compiler, then you will want to make sure that your compiler attempts to compile C instead of C++ to avoid small compatibility issues in later tutorials.  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;  Each of these compilers is slightly different. Each one should support the ANSI standard C functions, but each compiler will also have nonstandard functions (these functions are similar to slang spoken in different parts of a country). Sometimes the use of nonstandard functions will cause problems when you attempt to compile source code (the actual C code written by a programmer and saved as a text file) with a different compiler. These tutorials use ANSI standard C and should not suffer from this problem; fortunately, since C has been around for quite a while, there shouldn't be too many compatibility issues except when your compiler tries to create C++ code. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;  If you don't yet have a compiler I strongly recommend finding one now. A simple compiler is sufficient for our use, but make sure that you do get one in order to get the most from these tutorials. The page linked above&lt;/span&gt;&lt;span style="text-decoration: underline; font-weight: bold;"&gt;,&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; lists compilers by operating system. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;  Every full C program begins inside a function called "main".  A function is simply a collection of commands that do "something".  The main function is always called when the program first executes. From main, we can call other functions, whether they be written by us or by others or use built-in language features. To access the standard functions that comes with your compiler, you need to include a header with the #include directive.  What this does is effectively take everything in the header and paste it into your program. Let's look at a working program:&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4157222961107208557-7626321422533804370?l=cfundas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cfundas.blogspot.com/feeds/7626321422533804370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4157222961107208557&amp;postID=7626321422533804370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4157222961107208557/posts/default/7626321422533804370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4157222961107208557/posts/default/7626321422533804370'/><link rel='alternate' type='text/html' href='http://cfundas.blogspot.com/2007/12/c-introduction.html' title='C Introduction'/><author><name>chandana</name><uri>http://www.blogger.com/profile/01357047001736802270</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
