<?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>Freshers Times &#187; C Programming</title>
	<atom:link href="http://www.fresherstimes.com/category/tutorial/c-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fresherstimes.com</link>
	<description>Freshers Jobs n Entry Level Careers in India</description>
	<lastBuildDate>Tue, 25 May 2010 16:41:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Variable Types in C Programming Language</title>
		<link>http://www.fresherstimes.com/tutorial/c-programming/variable-types-c-language/</link>
		<comments>http://www.fresherstimes.com/tutorial/c-programming/variable-types-c-language/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 05:48:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[c programming variable types]]></category>
		<category><![CDATA[C Variable Types]]></category>

		<guid isPermaLink="false">http://www.fresherstimes.com/?p=7876</guid>
		<description><![CDATA[Variable Types in C Programming Language
Variables are names which are declared in order to store a single value that can either be an integer or a character. It is must to declare the type of the variable also i.e int, char etc. Generally there are two types of variables namely :

 Global variables
 Local variables

These [...]]]></description>
			<content:encoded><![CDATA[<h3 style="text-align: center;">Variable Types in C Programming Language</h3>
<p style="text-align: justify;">Variables are names which are declared in order to store a single value that can either be an integer or a character. It is must to declare the type of the variable also i.e int, char etc. Generally there are two types of variables namely :</p>
<ol>
<li> Global variables</li>
<li> Local variables</li>
</ol>
<p>These variables are classified on the basis of their place of declaration.<span id="more-7876"></span></p>
<h3>Global Variables:</h3>
<ul>
<li> If a variable is declared outside all the functions, then it is said to be <em><strong>global variable</strong></em>.</li>
<li>A global variable is available to all the functions and each part of the program.</li>
<li>When a program is executed then a global variable comes into consideration.</li>
<li>A global variable is destroyed when the program is terminated.</li>
<li>Global variables can be accessed from any part of the file or program.</li>
</ul>
<p><span style="text-decoration: underline;"><strong>Example:</strong></span></p>
<blockquote><p>#include<br />
int a;<br />
int b;<br />
char ch;<br />
void main()<br />
{<br />
printf(“\n enter the numbers :”);<br />
scanf(“%d%d”,a,b);<br />
printf(“\n enter the character”);<br />
scanf(“%c”,ch);<br />
}</p></blockquote>
<p style="text-align: justify;">Now from the above example we can see that ‘a’ and ‘b’ are integer variables and ‘ch’ is a character variable which is declared outside the main function. Therefore, these variables are known as global variables. These variables can be accessed from any part of the program.</p>
<h3><strong>Local Variables:</strong></h3>
<ul>
<li>Local variables are the ones that are defined within a function.</li>
<li>A local variable comes into existence when any function is entered.</li>
<li>A local variable is terminated when we exits from the function.</li>
<li>These variables cannot be accessed from outside the function.</li>
<li>A local variable needs to be declared every time after the function call.</li>
</ul>
<p><span style="text-decoration: underline;"><strong>Example:</strong></span></p>
<blockquote><p>#include<br />
int  main()<br />
{<br />
int i;<br />
int j;<br />
int add(i,j);<br />
}<br />
int add(int x , int y)<br />
{<br />
int result;<br />
result = x + y;<br />
printf(“%d the result is:”,result);<br />
return result;<br />
}</p></blockquote>
<p style="text-align: justify;">Now from the above code we can see that all the variables are declared within the function and these variables will be executed when we enter any function. Therefore, these variables are not allowed to be accessed from any part of the code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fresherstimes.com/tutorial/c-programming/variable-types-c-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Derived Data Types in C Programming Language</title>
		<link>http://www.fresherstimes.com/tutorial/c-programming/derived-data-types-c-language/</link>
		<comments>http://www.fresherstimes.com/tutorial/c-programming/derived-data-types-c-language/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 19:51:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[C Derived Data Types]]></category>
		<category><![CDATA[Derived Data Type C Programming]]></category>

		<guid isPermaLink="false">http://www.fresherstimes.com/?p=7870</guid>
		<description><![CDATA[Derived Data Types in C Language
Derived data types in C Programming Language are those C data types which are derived from the fundamental data types using some declaration operators.
Now, in this tutorial we will be discussing each of these derived data types in brief as we will again come across these topics in the next [...]]]></description>
			<content:encoded><![CDATA[<h3 style="text-align: center;">Derived Data Types in C Language</h3>
<p><em><strong>Derived data types</strong></em> in C Programming Language are those <em><strong><a title="Data Types in C Language" href="http://www.fresherstimes.com/tutorial/c-programming/c-language-data-types/" target="_blank">C data types</a></strong></em> which are derived from the fundamental data types using some declaration operators.</p>
<p>Now, in this tutorial we will be discussing each of these derived data types in brief as we will again come across these topics in the next coming up sections.</p>
<p>1. <span style="text-decoration: underline;"><strong>Arrays:</strong></span><br />
Arrays can be defined as a set of finite and homogeneous data elements. Each element of an array is referenced using an index.</p>
<p>For example:<br />
If we the name of an array is AR which have 5 elements then the array will be represented as :<br />
<em>AR[0], AR[1], AR[2], AR[3], AR[4]</em><br />
Here, these subscripts which are containing the digit is known as an index.<img title="More..." src="http://www.fresherstimes.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /><span id="more-7870"></span></p>
<p>There are various types of arrays namely:</p>
<ul>
<li> One dimensional</li>
<li> Two dimensional</li>
<li> Multi dimensional</li>
</ul>
<p>The elements of an array are indexed from 0 to size-1. It is necessary to declare the size of an array before initialization. An array can be initialize by placing the elements of an array within the curly braces.</p>
<p>For example, an array initialization can be done in following manner:</p>
<blockquote><p>int AR[5] = {5, 2, 6, 8, 3};</p></blockquote>
<p><strong>A sample program of an array:</strong></p>
<blockquote><p>#include<br />
Void main()<br />
{<br />
int arr[10];<br />
arr[10] = {1,5,4,6,3,9,14,81,7,11};<br />
printf(“\n %d”,arr[i]);<br />
}</p></blockquote>
<p>2. <span style="text-decoration: underline;"><strong>Functions:</strong></span><br />
A function can be defined as a part of the program which is declared by the programmer in any part of the program and a function can be of any name depending upon the choice of the programmer. The function declared can be invoked from other part of the program.</p>
<p><strong>Example of a function:</strong></p>
<blockquote><p>#include<br />
Float square(float);<br />
Void main()<br />
{<br />
Float num=3.14;<br />
Float sq;<br />
Sq=square(num);<br />
Printf(“%f”,sq);<br />
}</p>
<p>Float square(float x)<br />
{<br />
Return x * x;<br />
}</p></blockquote>
<p>The above code will print the square of the above given number. square is the name of the function used. And sq is the variable used to store the value of the square. The use of the function before the main function is known as declaration of the function, then comes the definition of a function which takes place outside the main function. Then finally comes the calling of the function which takes place inside the main function.</p>
<p>3. <span style="text-decoration: underline;"><strong>Pointers:</strong></span><br />
A pointer is a variable that holds the address of the memory space. We can say that if one variable can hold the address of the another variable then it is said that the first variable is pointing to the second.</p>
<p>A pointer is declared in a following manner:</p>
<blockquote><p>int *temp;</p></blockquote>
<p>i.e. first we have to declare the type and then the variable name precede by an * (asterisk) sign.</p>
<p>The pointer variable always occupies 2 bytes of memory.</p>
<p>4. <span style="text-decoration: underline;"><strong>Structures:</strong></span><br />
A Structure can be defined as a collection or a group of variables that are referenced under one name. it is used to keep related information together. Here we use a <em><strong>‘struct’</strong></em> <em><strong><a title="Keywords in C Programming Language" href="http://www.fresherstimes.com/tutorial/c-programming/c-language-keywords/" target="_blank">keyword</a></strong></em> to construct a structure.</p>
<p>Example:</p>
<blockquote><p>Struct bank<br />
{<br />
Char name[30];<br />
Int account_no;<br />
Int amount;<br />
};</p>
<p>Struct b;</p></blockquote>
<p>In the above example bank is the name of the structure, then we have declared the variables which are the elements of this structure. And b is the object of the structure which is used to refer the elements of the <em><strong><a title="Basic Program Structure in C" href="http://www.fresherstimes.com/tutorial/c-programming/c-program-structure/" target="_blank">structure</a></strong></em>.</p>
<p>Elements will be referred as :</p>
<p><em>b.amount=5000;<br />
b.account_no=2546321;</em></p>
<p>5. <span style="text-decoration: underline;"><strong>Class:</strong></span><br />
A class can be defined as a group of objects which are similar or of the same kind. Here a keyword ‘class’ is used to construct a class. A Class almost follows the same declaration procedure as we did in case of structures. But here comes the concept of access specifiers which applies a kind of restriction on the data. There are three types of access specifiers namely public, protected and private.</p>
<p>Example of a class:</p>
<blockquote><p>Class student<br />
{<br />
Char name[20];<br />
Int roll_no;<br />
Public:<br />
Details();<br />
Display();<br />
};</p></blockquote>
<blockquote><p>Student stud;</p></blockquote>
<p>In the above example the student is the name of the class, and stud is the name of the object. Here two functions details and display are called member functions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fresherstimes.com/tutorial/c-programming/derived-data-types-c-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C Language Operator Types: Operators in C</title>
		<link>http://www.fresherstimes.com/tutorial/c-programming/c-language-operator-types/</link>
		<comments>http://www.fresherstimes.com/tutorial/c-programming/c-language-operator-types/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 16:49:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[Arithmetic Operators in C Language]]></category>
		<category><![CDATA[Bitwise Operators in C]]></category>
		<category><![CDATA[C Programming Relational Operators]]></category>
		<category><![CDATA[Conditional Operators C language]]></category>
		<category><![CDATA[Logical Operators in C Programming]]></category>

		<guid isPermaLink="false">http://www.fresherstimes.com/?p=8014</guid>
		<description><![CDATA[Kind of Operator Types in C Programming Language
Operators:
An operator can be defined as a thing which is used to represent the operations or specific tasks and the objects of the operations are referred to as operands.
There are various types of operators :
1)     Arithmetic operators
2)     Logical operators
3)     Relational operators
4)     Increment and decrement operators
5)     Conditional operators
6)     Bitwise [...]]]></description>
			<content:encoded><![CDATA[<h3 style="text-align: center;"><strong>Kind of Operator Types in C Programming Language</strong></h3>
<p><span style="text-decoration: underline;"><strong>Operators:</strong></span></p>
<p style="text-align: justify;">An operator can be defined as a thing which is used to represent the <strong><em>operations</em></strong> or <strong><em>specific tasks</em></strong> and the objects of the operations are referred to as <strong><em>operands</em></strong>.</p>
<p>There are various types of operators :</p>
<p>1)     Arithmetic operators</p>
<p>2)     Logical operators</p>
<p>3)     Relational operators</p>
<p>4)     Increment and decrement operators</p>
<p>5)     Conditional operators</p>
<p>6)     Bitwise operators</p>
<p>Now we will look at these operator types one by one.<span id="more-8014"></span></p>
<ul>
<li><strong><span style="text-decoration: underline;">Arithmetic Operators</span></strong>:</li>
</ul>
<p style="text-align: justify;">C provides five basic arithmetic operators for calculations like : addition, subtraction, multiplication, division and remainder which are +, -, *, / and % respectively. All these operators are called binary operators as these require two operands or values.</p>
<p>Arithmetic operators are divided into two types :</p>
<ul>
<li>Unary operators : acts on one operand only.</li>
<li>Binary operators : acts on two operands.</li>
</ul>
<table border="1" cellspacing="0" cellpadding="0" width="456">
<tbody>
<tr>
<td width="86" valign="top">symbol</td>
<td width="86" valign="top">name</td>
<td width="86" valign="top">example</td>
<td width="86" valign="top">result</td>
<td width="110" valign="top">comment</td>
</tr>
<tr>
<td width="86" valign="top">+</td>
<td width="86" valign="top">addition</td>
<td width="86" valign="top">5 + 2</td>
<td width="86" valign="top">7</td>
<td width="110" valign="top">Adds values of operands</td>
</tr>
<tr>
<td width="86" valign="top">-</td>
<td width="86" valign="top">Subtraction</td>
<td width="86" valign="top">5 &#8211; 2</td>
<td width="86" valign="top">3</td>
<td width="110" valign="top">Subtracts values of operands</td>
</tr>
<tr>
<td width="86" valign="top">*</td>
<td width="86" valign="top">multiplication</td>
<td width="86" valign="top">5 * 2</td>
<td width="86" valign="top">10</td>
<td width="110" valign="top">Multiplies the values of two operands</td>
</tr>
<tr>
<td width="86" valign="top">/</td>
<td width="86" valign="top">division</td>
<td width="86" valign="top">10 / 2</td>
<td width="86" valign="top">5</td>
<td width="110" valign="top">Divides the value of left operand with right value</td>
</tr>
<tr>
<td width="86" valign="top">%</td>
<td width="86" valign="top">modulus</td>
<td width="86" valign="top">3 % 2</td>
<td width="86" valign="top">1</td>
<td width="110" valign="top">Checks the remainder</td>
</tr>
</tbody>
</table>
<p>The above table gives the complete idea of the <strong><em>binary operators</em></strong>.</p>
<ul>
<li><strong><span style="text-decoration: underline;">Logical Operators</span></strong> :</li>
</ul>
<p style="text-align: justify;">In this section we talks about the logical operators that refers to the ways in which the relationships can be connected. C provides three logical operators. These are :</p>
<table border="1" cellspacing="0" cellpadding="0" width="460">
<tbody>
<tr>
<td width="90" valign="top">Symbol</td>
<td width="89" valign="top">name</td>
<td width="90" valign="top">example</td>
<td width="89" valign="top">result</td>
<td width="103" valign="top">comment</td>
</tr>
<tr>
<td width="90" valign="top">&amp;&amp;</td>
<td width="89" valign="top">And</td>
<td width="90" valign="top">(6&gt;3) &amp;&amp; (5&lt;8)</td>
<td width="89" valign="top">1</td>
<td width="103" valign="top">Result is true i.e. 1 as both   expressions are true.</td>
</tr>
<tr>
<td width="90" valign="top">||</td>
<td width="89" valign="top">Or</td>
<td width="90" valign="top">(5&gt;8) || (6&gt;2)</td>
<td width="89" valign="top">1</td>
<td width="103" valign="top">Result is 1 as at least one expression   is true.</td>
</tr>
<tr>
<td width="90" valign="top">!</td>
<td width="89" valign="top">Not</td>
<td width="90" valign="top">!(4&lt;=4)</td>
<td width="89" valign="top">0</td>
<td width="103" valign="top">Result is false. Negates the result of   expression.</td>
</tr>
</tbody>
</table>
<ul>
<li><strong><span style="text-decoration: underline;">Relational Operators:</span></strong></li>
</ul>
<p style="text-align: justify;">The relational operator determines the relation among different operands. C provides six relational operators for comparing numbers and characters. The following relational operators are:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="96" valign="top">symbol</td>
<td width="96" valign="top">Name</td>
<td width="96" valign="top">Example</td>
<td width="96" valign="top">Result</td>
<td width="96" valign="top">Comment</td>
</tr>
<tr>
<td width="96" valign="top">==</td>
<td width="96" valign="top">Comparison</td>
<td width="96" valign="top">5 == 3</td>
<td width="96" valign="top">0 i.e. false</td>
<td width="96" valign="top">Compares two values</td>
</tr>
<tr>
<td width="96" valign="top">&lt;</td>
<td width="96" valign="top">Less than</td>
<td width="96" valign="top">6 &lt; 2</td>
<td width="96" valign="top">1</td>
<td width="96" valign="top">Result is true</td>
</tr>
<tr>
<td width="96" valign="top">&lt;=</td>
<td width="96" valign="top">Less than or equal to</td>
<td width="96" valign="top">3 &lt;= 10</td>
<td width="96" valign="top">1</td>
<td width="96" valign="top">Result is true as 3 is less than 10.</td>
</tr>
<tr>
<td width="96" valign="top">&gt;</td>
<td width="96" valign="top">Greater than</td>
<td width="96" valign="top">6 &gt; 5</td>
<td width="96" valign="top">0</td>
<td width="96" valign="top">Result is false.</td>
</tr>
<tr>
<td width="96" valign="top">&gt;=</td>
<td width="96" valign="top">Greater than or equal to</td>
<td width="96" valign="top">6 &gt; = 5</td>
<td width="96" valign="top">1</td>
<td width="96" valign="top">Result is true as 6 is greater than 5.</td>
</tr>
<tr>
<td width="96" valign="top">!=</td>
<td width="96" valign="top">Not equal to</td>
<td width="96" valign="top">6 != 3</td>
<td width="96" valign="top">0</td>
<td width="96" valign="top">Result is true.</td>
</tr>
</tbody>
</table>
<ul>
<li><strong><span style="text-decoration: underline;">Increment &amp; Decrement Operator:</span></strong></li>
</ul>
<p>Increment operator is denoted by <strong><em>++</em></strong> and decrement operator is denoted by <strong><em>&#8211;</em></strong>.</p>
<p>The  operator ++ adds 1 to its operand and &#8212; operator subtracts 1 from the operand.</p>
<p>In other words,</p>
<blockquote><p>X = x + 1;</p>
<p>Is same as ++x or x++;</p></blockquote>
<p>And</p>
<blockquote><p>X = x – 1;</p>
<p>Is same as &#8211;x or x&#8211;;</p></blockquote>
<ul>
<li><strong><span style="text-decoration: underline;">Conditional Operators :</span></strong></li>
</ul>
<p>Conditional operator stores a value depending upon the condition. This operator is ternary operator as it requires three operands.</p>
<p>General form is:</p>
<blockquote><p>Expression1 ? expression2 : expression3</p></blockquote>
<p style="text-align: justify;">If expression1 evaluates to true i.e. 1, then the value of the whole expression is the value of expression2, otherwise the value of whole expression is the value of expression3.</p>
<ul>
<li><strong><span style="text-decoration: underline;">Bitwise Operators:</span></strong></li>
</ul>
<p style="text-align: justify;">One of the powerful features of C is a set of bit manipulation operators. These permit the programmer to access and manipulate individual bits within a piece of data. The various bitwise operators are :</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="239" valign="top">operator</td>
<td width="239" valign="top">meaning</td>
</tr>
<tr>
<td width="239" valign="top">~</td>
<td width="239" valign="top">One’s   complement</td>
</tr>
<tr>
<td width="239" valign="top">&gt;&gt;</td>
<td width="239" valign="top">Right shift</td>
</tr>
<tr>
<td width="239" valign="top">&lt;&lt;</td>
<td width="239" valign="top">Left shift</td>
</tr>
<tr>
<td width="239" valign="top">&amp;</td>
<td width="239" valign="top">Bitwise   AND</td>
</tr>
<tr>
<td width="239" valign="top">|</td>
<td width="239" valign="top">Bitwise OR</td>
</tr>
<tr>
<td width="239" valign="top">^</td>
<td width="239" valign="top">Bitwise XOR(exclusive OR)</td>
</tr>
</tbody>
</table>
<p>Now  if we consider the values of A and B to be 20 and 15 then in binary format it will be represented as :</p>
<p>A = 0011 1100</p>
<p>B = 0000 1101</p>
<p>Then the bitwise operators will perform such operations :</p>
<p>1)     A&amp;B = 0000 1000</p>
<p>2)     A|B = 0011 1101</p>
<p>3)     A^B = 0011 0001</p>
<p>4) ~A  = 1100 0011</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fresherstimes.com/tutorial/c-programming/c-language-operator-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C Programming Primary Constants: Integer, Real &amp; Character</title>
		<link>http://www.fresherstimes.com/tutorial/c-programming/c-language-primary-constants/</link>
		<comments>http://www.fresherstimes.com/tutorial/c-programming/c-language-primary-constants/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 16:33:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[C Language Basic Tutorial]]></category>
		<category><![CDATA[C Real Constants]]></category>
		<category><![CDATA[Character Constants in C]]></category>
		<category><![CDATA[Integer Constants in C]]></category>

		<guid isPermaLink="false">http://www.fresherstimes.com/?p=8008</guid>
		<description><![CDATA[Integer, Real &#38; Character: C Primary Constants
In the last article we gave an introduction about the kinds of Constants in C Language.
In this article we will discuss only about primary constants and secondary constants will be discussed in the later articles.
1) Integer Constants:

It contains at least one digit.
Fractions or decimals are not allowed.
By default an integer [...]]]></description>
			<content:encoded><![CDATA[<h3 style="text-align: center;">Integer, Real &amp; Character: C Primary Constants</h3>
<p>In the last article we gave an introduction about the kinds of Constants in <strong><em>C Language</em></strong>.</p>
<p>In this article we will discuss only about <strong><em>primary constants</em></strong> and <strong><em>secondary constants</em></strong> will be discussed in the later articles.</p>
<p><strong>1) Integer Constants:</strong></p>
<ol>
<li>It contains at least one digit.</li>
<li>Fractions or decimals are not allowed.<span id="more-8008"></span></li>
<li>By default an integer constant is considered to be positive.</li>
<li>Blank spaces and commas are not allowed.</li>
<li>The <a title="Range of C Data Types" href="http://www.fresherstimes.com/tutorial/c-programming/c-data-types-range-size/" target="_blank">range of all the integer constants</a> has been discussed earlier.</li>
</ol>
<p>For example :</p>
<blockquote><p>const int age=20;</p></blockquote>
<p>and</p>
<blockquote><p>int const age=20;</p></blockquote>
<p>Above example tells us about the declaration of an integer constants and we can use any of the form as shown above.</p>
<p><strong>2) Real Constants</strong>:</p>
<ol>
<li>They are also known as  floating point constants. Fractional and exponential form are the parts of the real constants.</li>
<li>It needs to have at least one digit.</li>
<li>Decimal point needs to be there.</li>
<li>It can be positive or negative but by default real constants are positive.</li>
<li>It is similar to integer constants but the difference is that decimal point is required in integer constants.</li>
</ol>
<p><strong>3) Character Constants:</strong></p>
<p><strong></strong>Characters enclosed in single quotes are known as character constants and characters enclosed within double quotes are known as string constants. There are certain characters which cannot be represented in this manner therefore we follow a different character sequence i.e.</p>
<p>We use:</p>
<ul>
<li>‘\n’ for new line.</li>
<li>‘\t’ for space.</li>
<li>‘\0’ for null elements etc.</li>
</ul>
<p>This is all about the primary constants. We will be discussing secondary constants in the <strong>next tutorial</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fresherstimes.com/tutorial/c-programming/c-language-primary-constants/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Constants in C Programming Language: Primary &amp; Secondary</title>
		<link>http://www.fresherstimes.com/tutorial/c-programming/constants-c-language/</link>
		<comments>http://www.fresherstimes.com/tutorial/c-programming/constants-c-language/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 16:28:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[C Language Constants]]></category>
		<category><![CDATA[Const Keyword in C]]></category>

		<guid isPermaLink="false">http://www.fresherstimes.com/?p=8007</guid>
		<description><![CDATA[Constants in C Programming Language
The keyword const can be added to the declaration of an object to make that object a constant rather than a variable.
The general syntax of constant declaration is :
Const data-type name = value;
Here const is known as a keyword that must be used to declare a constant.  Name is the name [...]]]></description>
			<content:encoded><![CDATA[<h3 style="text-align: center;"><strong>Constants in C Programming Language</strong></h3>
<p>The <a title="32 Reserved Words in C" href="http://www.fresherstimes.com/india/32-keywords-c-language/" target="_blank"><strong>keyword</strong></a> <strong><em>const</em></strong> can be added to the declaration of an object to make that object a constant rather than a <a title="Variable Types in C" href="http://www.fresherstimes.com/india/c-programming-variable-types/" target="_blank"><strong>variable</strong></a>.</p>
<p>The general syntax of constant declaration is :</p>
<blockquote><p>Const data-type name = value;</p></blockquote>
<p>Here const is known as a keyword that must be used to declare a constant.  Name is the name of the constant, data-type is the type of the data which we are declaring and value is the constant value of the data-type.<span id="more-8007"></span></p>
<p>For example :</p>
<blockquote><p>Const int manager_id=001;</p></blockquote>
<p>Here we declared a constant named as manager_id of type integer which is assigned a value 001.</p>
<p><span style="text-decoration: underline;"> </span></p>
<p><span style="text-decoration: underline;"><strong>Types Of Constants:</strong></span></p>
<p>C constants can be divided into two categories :</p>
<ul>
<li>Primary constants</li>
<li>Secondary constants</li>
</ul>
<p><strong>Primary constants</strong> are further divided into :</p>
<ul>
<li>Integer constants</li>
<li>Real constants</li>
<li>Character constants</li>
</ul>
<p><strong>Secondary constants</strong> are further divided into :</p>
<ul>
<li>Array</li>
<li>Pointers</li>
<li>Union</li>
<li>Structures</li>
<li>Enum etc</li>
</ul>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fresherstimes.com/tutorial/c-programming/constants-c-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Storage Classes in C Programming Language: Auto, Register, Extern &amp; Static Storage Types</title>
		<link>http://www.fresherstimes.com/tutorial/c-programming/storage-classes-c-language/</link>
		<comments>http://www.fresherstimes.com/tutorial/c-programming/storage-classes-c-language/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 15:23:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[C Language Storage Types]]></category>
		<category><![CDATA[C Storage Class Specifiers]]></category>
		<category><![CDATA[Storage Types in C Program]]></category>

		<guid isPermaLink="false">http://www.fresherstimes.com/?p=8000</guid>
		<description><![CDATA[Storage Types in C Programming Language
A storage class is used to tell the compiler how to store the variables and functions within a program or code. It is generally represented as :
Storage-class type variable-name ;
Different types of storage classes used in a C program are :

Auto
Register
Extern
Static

The names of these storage classes comes under the list [...]]]></description>
			<content:encoded><![CDATA[<h3 style="text-align: center;"><span style="text-decoration: underline;"><strong>Storage Types in C Programming Languag</strong><strong>e</strong></span></h3>
<p>A <strong><em>storage class</em></strong> is used to tell the compiler how to store the variables and functions within a program or code. It is generally represented as :</p>
<blockquote><p>Storage-class type variable-name ;</p></blockquote>
<p>Different types of storage classes used in a <strong><a title="C Language Program Structure" href="http://www.fresherstimes.com/tutorial/c-programming/c-program-structure/" target="_blank">C program</a></strong> are :</p>
<ol>
<li>Auto</li>
<li>Register</li>
<li>Extern</li>
<li>Static<span id="more-8000"></span></li>
</ol>
<p>The names of these storage classes comes under the list of <a title="Keywords in C Language" href="http://www.fresherstimes.com/tutorial/c-programming/c-language-keywords/" target="_blank">keywords</a>. Therefore these storage classes are known as <strong><em>reserved words <span style="font-weight: normal;"><span style="font-style: normal;">or</span></span> keywords</em></strong>.</p>
<p><strong><span style="text-decoration: underline;">Auto &#8211; Storage Class</span></strong></p>
<p>The storage class auto refers to automatic variable.</p>
<p><strong>Syntax:</strong></p>
<blockquote><p>Auto type variable-name;</p></blockquote>
<p>That means the keyword auto just precedes the normal variable declaration.</p>
<p><strong>Note</strong> :</p>
<p>In c language all the variables which are defined within a function are automatic or in other words we can say that if we do not apply keyword auto before a variable which is defined within a function will be treated as an automatic variable.</p>
<p>Auto is used only for the local variables.</p>
<p>Example of variable declaration with keyword auto is shown below :</p>
<blockquote><p>Void main()</p>
<p>{</p>
<p>auto int age;</p>
<p>auto char name;</p>
<p>int roll_no;</p>
<p>int marks;</p>
<p>}</p></blockquote>
<p style="text-align: justify;">In the above example there are 4 variables defined inside the main function. Out of which two are defined using keyword auto and other two are defined without using it but all these variables will perform the same function.</p>
<p><span style="text-decoration: underline;"><strong>Register</strong> <strong>– Storage Class</strong></span></p>
<p style="text-align: justify;">A register declaration or a register storage class has all the characteristics of an auto variable. But the difference is that, register variables provides faster access as these variables are stored inside the CPU registers instead of storing them in the memory. The register can be applied only to the local variables.</p>
<p style="text-align: justify;">But variable stored in registers should not have any kind of operators attached to it as operators have no allocated memory in the registers.</p>
<p><strong>Syntax:</strong></p>
<blockquote><p>register type variable-name;</p></blockquote>
<p>Example of variable declaration with keyword register is shown below :</p>
<blockquote><p>Void main()</p>
<p>{</p>
<p>register int distance;</p>
<p>register int count;</p>
<p>}</p></blockquote>
<p>The variables with keywords are defined within the main function which shows that these variables are local variables.</p>
<p><strong><span style="text-decoration: underline;">Extern &#8211; Storage Class</span></strong></p>
<p style="text-align: justify;"><a title="History Of C Programming Language" href="http://www.fresherstimes.com/tutorial/c-programming/c-language-introduction-history-advantages/" target="_blank">C Languag</a>e allows us to split the large program into different files. A file can contain some functions and rest of the files contains the other functions in the program. Then these files can be separately compiled and then later linked together for the program execution. If we have declared a global variable then in c we are not allowed to declare it again in some other file.</p>
<p style="text-align: justify;">The ‘extern’ keyword comes into existence if that other file is using the global variable that is defined outside the file. The extern storage class tells the compiler that the variable types and names that follow it have been declared so that no fresh memory is allocated to these variables.</p>
<p>Note:</p>
<p>The extern storage class is used only for <strong><em>global variables</em></strong>.</p>
<ul>
<li>An extern variable is initialized by the program when the file is first loaded.</li>
<li>Extern is a keyword which is used to represent external variable.</li>
<li>The lifetime of the external variables remains as long as the program runs.</li>
</ul>
<p><strong>Syntax:</strong></p>
<blockquote><p>extern type variable-name;</p>
<p>extern function-prototype;</p></blockquote>
<p><strong>Example:</strong></p>
<blockquote><p>extern int I, j;</p>
<p>extern void cube (int x);</p></blockquote>
<p>The keyword <strong><em>extern</em></strong> is optional for a function prototype.</p>
<p><strong><span style="text-decoration: underline;">Static &#8211; Storage Class</span></strong></p>
<p style="text-align: justify;">In C we can have static global variables as well as static local variables. The static variables are permanent within their own function in case of local variables and file in case of global variables. These variables maintain their values between calls. A static global variable is available only inside the file where it has been declared.</p>
<p style="text-align: justify;">When a static modifier is applied to the local variable, it is initialized only when the very first call to the function occurs. It is not finished when the function terminates  but it holds its value even after function’s termination but it can only be accessed within its own function.</p>
<p><strong>Example:</strong></p>
<blockquote><p>Void fact (void)</p>
<p>{ static int num=10;</p>
<p>Int count=0;</p>
<p>}</p></blockquote>
<p>A static global variable is useful when we want to create a global variable only for the function of one particular file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fresherstimes.com/tutorial/c-programming/storage-classes-c-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C Data Types: Range &amp; Size</title>
		<link>http://www.fresherstimes.com/tutorial/c-programming/c-data-types-range-size/</link>
		<comments>http://www.fresherstimes.com/tutorial/c-programming/c-data-types-range-size/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 21:32:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[c data type byte]]></category>
		<category><![CDATA[c data type lengths]]></category>
		<category><![CDATA[c data type sizes]]></category>
		<category><![CDATA[C Data Types]]></category>

		<guid isPermaLink="false">http://www.fresherstimes.com/?p=6948</guid>
		<description><![CDATA[C Programming Language Data Type Sizes, Range &#038; Bytes.]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">We have already discussed the <a title="C Data Types" href="http://www.fresherstimes.com/tutorial/c-programming/c-language-data-types/" target="_blank">Data Types in C</a> in the previous tutorial.</p>
<p style="text-align: justify;">The following Chart will give you the <em><strong>range &amp; sizes</strong></em> of all the <a title="C Language Data Types" href="http://www.fresherstimes.com/india/c-data-types/" target="_blank">data types in C</a> Language along with their <a title="Type Modifiers in C Language" href="http://www.fresherstimes.com/tutorial/c-programming/type-modifiers-c-language/" target="_blank">Type Modifiers</a>.</p>
<table style="text-align: justify; height: 333px;" border="1" width="438">
<tbody>
<tr>
<th>
<h2><strong>Data Type</strong></h2>
</th>
<th>
<h2><strong>Range</strong></h2>
</th>
<th>
<h2><strong>Bytes</strong></h2>
</th>
</tr>
<tr>
<td><strong>signed char</strong></td>
<td><strong>-128 to + 127</strong></td>
<td><strong>1</strong></td>
</tr>
<tr>
<td><strong>unsigned char</strong></td>
<td><strong>0 to 255</strong></td>
<td><strong>1</strong></td>
</tr>
<tr>
<td><strong>short signed int</strong></td>
<td><strong>-32768 to +32767</strong></td>
<td><strong>2</strong></td>
</tr>
<tr>
<td><strong>short unsigned int</strong></td>
<td><strong>0 to 65535</strong></td>
<td><strong>2</strong></td>
</tr>
<tr>
<td><strong>signed int</strong></td>
<td><strong>-32768 to +32767</strong></td>
<td><strong>2</strong></td>
</tr>
<tr>
<td><strong>unsigned int</strong></td>
<td><strong>0 to 65535</strong></td>
<td><strong>2</strong></td>
</tr>
<tr>
<td><strong>long signed int</strong></td>
<td><strong>-2147483648 to +2147483647</strong></td>
<td><strong>4</strong></td>
</tr>
<tr>
<td><strong>long signed int</strong></td>
<td><strong>-2147483648 to +2147483647</strong></td>
<td><strong>4</strong></td>
</tr>
<tr>
<td><strong>long unsigned int</strong></td>
<td><strong>0 to 4294967295</strong></td>
<td><strong>4</strong></td>
</tr>
<tr>
<td><strong>float</strong></td>
<td><strong>-3.4e38 to +3.4e38</strong></td>
<td><strong>4</strong></td>
</tr>
<tr>
<td><strong>double</strong></td>
<td><strong>-1.7e308 to +1.7e308</strong></td>
<td><strong>8</strong></td>
</tr>
<tr>
<td><strong>long double</strong></td>
<td><strong>-1.7e4932 to +1.7e4932</strong></td>
<td><strong>10</strong></td>
</tr>
</tbody>
</table>
<p>This Chart will help you in greater extent in finding the exact range &amp; size of the data types in C Language.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fresherstimes.com/tutorial/c-programming/c-data-types-range-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Type Modifiers in C Language: signed, unsigned, long &amp; short</title>
		<link>http://www.fresherstimes.com/tutorial/c-programming/type-modifiers-c-language/</link>
		<comments>http://www.fresherstimes.com/tutorial/c-programming/type-modifiers-c-language/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 20:12:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[C Programming Data Qualifiers]]></category>
		<category><![CDATA[Data Type Qualifiers in C]]></category>
		<category><![CDATA[int modifier]]></category>

		<guid isPermaLink="false">http://www.fresherstimes.com/?p=6878</guid>
		<description><![CDATA[Data Type Modifiers in C Language, C Data Type Qualifiers, Signed, Unsigned, Long, Short]]></description>
			<content:encoded><![CDATA[<h2 style="text-align: justify;">Data Type Modifiers/Qualifiers in C Language</h2>
<p style="text-align: justify;">In the previous tutorial we discussed about the primary <a title="Primary Data Types in C" href="http://www.fresherstimes.com/tutorial/c-programming/c-language-fundamental-data-types/" target="_blank">data types in C Language</a>. In addition, these <a title="C Data Types" href="http://www.fresherstimes.com/tutorial/c-programming/c-language-data-types/" target="_blank">data types</a> have some modifiers preceding them. The use  of these modifiers changes the meaning of the base type.</p>
<p style="text-align: justify;">The memory in the computer is organized in terms of units called <em><strong>bytes</strong></em>. One byte consists of <span style="text-decoration: underline;"><strong>8 bits</strong></span> and bit is a smallest unit of memory.</p>
<h2 style="text-align: justify;">Need of Data Modifiers:</h2>
<p style="text-align: justify;">Let us take an example of a Program where we need to input the &#8220;Salary&#8221; of &#8220;Employees&#8221;  in a team. This program will accept the salary as an input from user and then calculate the Income Tax of that user. We use &#8220;int&#8221; to store the Salary of the employee as we are assuming that the salary will be in &#8220;Whole Numbers&#8221;.</p>
<p style="text-align: justify;">An integer data type takes 2 Bytes of Memory and we are aware that the Salary of any of the employee can not be &#8220;Negative&#8221;. We are using &#8220;2 Bytes&#8221; to store the memory of an Employee and we can easily save 1 Byte over there by removing the &#8220;Signed Part&#8221; in the integer. This positive value can easily be stored in &#8220;1 Bye Int&#8221; This leads us to the user of Data Type Modifiers.<span id="more-6878"></span></p>
<h2 style="text-align: justify;">Types of Data Modifiers in C:</h2>
<p style="text-align: justify;">The modifiers are listed below :</p>
<h3 style="text-align: justify;">Signed Type Modifier:</h3>
<p style="text-align: justify;">All data types are &#8220;signed&#8221; by default. Signed Data Modifier implies that the data type variable can store positive values as well as negative values.</p>
<p style="text-align: justify;">For example, if we need to declare a variable to store temperature, it can be negative as well as positive.</p>
<blockquote style="text-align: justify;"><p>signed int temperature;</p>
<p>Or</p>
<p>int temperature;</p></blockquote>
<h3 style="text-align: justify;">Unsigned Type Modifier:</h3>
<p style="text-align: justify;">If we need to change the data type so that it can only store only store positive values, &#8220;unsigned&#8221; data modifier is used.</p>
<p style="text-align: justify;">For example, if we need to declare a variable to store the salary of an employee as explained above, we will use &#8220;Unsigned&#8221; Data Qualifier here.</p>
<blockquote style="text-align: justify;"><p>unsigned int salary;  <span style="color: #993333;"> </span><span style="color: #993333;"><br />
</span></p></blockquote>
<h3 style="text-align: justify;">Long Type Modifier:</h3>
<p style="text-align: justify;">Sometimes while coding a program, we need to increase the <em><strong>Storage Capacity</strong></em> of a variable so that it can store values higher than its maximum limit which is there as default. In such situations or programs, we need to make use of the &#8220;long&#8221; data type qualifier. &#8220;long&#8221; type modifier doubles the &#8220;length&#8221; of the data type when used along with it.</p>
<p style="text-align: justify;">For example, if we need to store the &#8220;annual turnover&#8221; of a company in a variable, we will make us of this type qualifier.</p>
<blockquote style="text-align: justify;"><p>long int turnover;</p></blockquote>
<p style="text-align: justify;">This variable will take <em><strong>4 Bytes</strong></em> in memory.</p>
<h3 style="text-align: justify;">Short Type Modifier:</h3>
<p style="text-align: justify;">A &#8220;short&#8221; type modifier does just the opposite of &#8220;long&#8221;. If one is not expecting to see high range values in a program and the values are both positive &amp; negative.</p>
<p style="text-align: justify;">For example, if we need to store the &#8220;age&#8221; of a student in a variable, we will make use of this type qualifier as we are aware that this value is not going to be very high.</p>
<blockquote style="text-align: justify;"><p>short int age;</p></blockquote>
<p style="text-align: justify;">This variable will consume only <em><strong>1 Byte</strong></em> in memory.</p>
<p style="text-align: justify;">We can apply the above mentioned modifiers to<strong><em> integer (int)</em></strong> and <strong><em>character (char)</em></strong> base types.</p>
<h3 style="text-align: justify;">1. Integer Type Modifiers:</h3>
<ul>
<li>We can use all the above mentioned Type Modifiers for int data type in C Language</li>
<li><em><strong>Short int</strong></em> and <em><strong>long int</strong></em> are also termed as <em><strong>short</strong></em> and <em><strong>long</strong></em> respectively.</li>
<li>Int is signed &amp; unsigned by default.</li>
</ul>
<h3 style="text-align: justify;">2. Character Type Modifiers:</h3>
<ul>
<li>Variables of type char consume 1 byte in memory.</li>
<li>Char can be signed or unsigned only.</li>
<li>They have a range of -128 to 127 and 0 to 255 for signed &amp; unsigned respectively.</li>
</ul>
<h3 style="text-align: justify;">3. Float Type &amp; Double Type Modifier:</h3>
<p style="text-align: justify;">There are 3 types of float type modifiers as given below:</p>
<ul>
<li>float</li>
<li>double</li>
<li>long double</li>
</ul>
<p>Double is same as long float. Float type occupies <em><strong>4 bytes</strong></em> of memory. Type double occupies <em><strong>8 bytes</strong></em>. Long double occupies <em><strong>10 bytes</strong></em>. The exception to this is long double, which modifies the size of the double data type to 10 bytes. Please note that in some compilers this has no effect.</p>
<p style="text-align: justify;"><strong>Note:</strong> We may use long modifier with double data type but it cannot be used with float, i.e. long double is allowed but long float is not allowed because long float is equal to double.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fresherstimes.com/tutorial/c-programming/type-modifiers-c-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C Language Fundamental Data Types: Int, Float, Char, Double</title>
		<link>http://www.fresherstimes.com/tutorial/c-programming/c-language-fundamental-data-types/</link>
		<comments>http://www.fresherstimes.com/tutorial/c-programming/c-language-fundamental-data-types/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 20:23:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[C Basic Data Types]]></category>
		<category><![CDATA[Char data type]]></category>
		<category><![CDATA[Double Data Type]]></category>
		<category><![CDATA[Float data Type]]></category>
		<category><![CDATA[Int Data Type]]></category>
		<category><![CDATA[Primary Data Types in C]]></category>

		<guid isPermaLink="false">http://www.fresherstimes.com/?p=6595</guid>
		<description><![CDATA[Fundamental Data Types in C, Basic Data Types of C Language]]></description>
			<content:encoded><![CDATA[<h2>Fundamental / Basic / Primary Data Types in C Language</h2>
<p>The fundamental data types are of following types:</p>
<h3>Integer(int) data type:</h3>
<p>Integers are <em><strong>whole numbers</strong></em>. They have no fractional parts. These integers are represented using int data type. Integers can be positive or negative. The integer variable consumes 2 bytes of memory in the code.<br />
<span style="text-decoration: underline;"><strong></strong></span></p>
<p><span style="text-decoration: underline;"><strong>Example:</strong></span></p>
<blockquote><p>#include<br />
Void main()<br />
{<br />
int num;<br />
num=17;<br />
}</p></blockquote>
<h3>Character(char) data type:<span id="more-6595"></span></h3>
<p>An identifier or a variable which is declared as a char becomes a character variable. The character variable consumes 1 byte of memory in the code.<br />
<span style="text-decoration: underline;"><strong></strong></span></p>
<p><span style="text-decoration: underline;"><strong>Example:</strong></span></p>
<blockquote><p>#include<br />
Void main()<br />
{<br />
char ch;<br />
char ch1;<br />
ch=’y’;<br />
ch1=’n’;<br />
}</p></blockquote>
<h3>Float(Decimal or Real Number ) data type:</h3>
<p>An identifier declared as a float becomes a floating-point variable or a decimal number. Any number which is having a fractional part is known as a floating point variable.<br />
<span style="text-decoration: underline;"><strong></strong></span></p>
<p><span style="text-decoration: underline;"><strong>Example:</strong></span></p>
<blockquote><p>#include<br />
Void main()<br />
{<br />
float inch;<br />
inch=9.5;<br />
}</p></blockquote>
<h3>Double data type:</h3>
<p>Double data type is also used for floating point numbers. But there is a difference in memory consumption. Float data type occupies 4 bytes of memory in the code whereas double occupies 8 bytes of memory i.e. twice as that of float.<br />
<span style="text-decoration: underline;"><strong></strong></span></p>
<p><span style="text-decoration: underline;"><strong>Example:</strong></span></p>
<blockquote><p>#include<br />
Void main()<br />
{<br />
double rupees;<br />
rupees=6530000;<br />
}</p></blockquote>
<p>These  data types have some modifiers associated with it which we will be discussing in the next section.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fresherstimes.com/tutorial/c-programming/c-language-fundamental-data-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C Language Data Types</title>
		<link>http://www.fresherstimes.com/tutorial/c-programming/c-language-data-types/</link>
		<comments>http://www.fresherstimes.com/tutorial/c-programming/c-language-data-types/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 19:49:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[C Data Types]]></category>
		<category><![CDATA[Data Types in C Language]]></category>

		<guid isPermaLink="false">http://www.fresherstimes.com/?p=6591</guid>
		<description><![CDATA[C Language Data Types, Primary, Secondary, Built-in, Derived, User Defined]]></description>
			<content:encoded><![CDATA[<h2>Data Types in C Language</h2>
<p>Data can be of many types e.g., integer, fraction or real, character, string etc.</p>
<ul>
<li> Numbers that does not have fraction part represents integer data.</li>
<li>Numbers with decimals or fraction represents real data.</li>
<li>Any data which is enclosed within single quotes represents character data.</li>
<li>Any data which is enclosed within double quotes represents a string.</li>
</ul>
<p>Since the data is of many types, therefore C language provides many ways and options to handle all kind of data.</p>
<p><em><strong>C Programming Language</strong></em> provides ways to handle different types of data by providing data types.<span id="more-6591"></span></p>
<h2>What is Data Type ?</h2>
<p><em><strong>&#8220;Data types</strong></em>&#8221; are defined as ways or means to identify the type of data and associated operations of handling it.</p>
<p>Data types can be divided into two types:</p>
<ul>
<li> Fundamental or Built-in data types (Primary Data Types)</li>
<li> Derived data types ( Secondary Data Types)</li>
<li>User Defined data types</li>
</ul>
<p><span style="text-decoration: underline;"><strong>Built-in Data Types</strong></span>:</p>
<p>The basic built-in or fundamental data types that are available in C are:</p>
<ol>
<li>Char</li>
<li>Int</li>
<li>Float</li>
<li>Double</li>
<li>Void</li>
</ol>
<table style="height: 107px;" border="1" cellspacing="0" cellpadding="0" width="243">
<tbody>
<tr>
<td valign="top">1.</td>
<td valign="top">Integer</td>
<td valign="top">int</td>
</tr>
<tr>
<td valign="top">2.</td>
<td valign="top">Character</td>
<td valign="top">char</td>
</tr>
<tr>
<td valign="top">3.</td>
<td valign="top">Floating Point</td>
<td valign="top">float</td>
</tr>
<tr>
<td valign="top">4.</td>
<td valign="top">Double precision floating point</td>
<td valign="top">double</td>
</tr>
<tr>
<td valign="top">5.</td>
<td valign="top">Void</td>
<td valign="top">void</td>
</tr>
</tbody>
</table>
<p><span style="text-decoration: underline;"><strong>Derived Data Types:</strong></span></p>
<p>The basic derived types that are available in C are:</p>
<p style="padding-left: 30px;">1. Array<br />
2. Functions and pointers<br />
3. Structures<br />
4. Classes etc..</p>
<p><span style="text-decoration: underline;"><strong>User defined Data Types:</strong></span></p>
<p>With the help of a user defined data type, a programmer can create an identifier that denotes an already existing data type. The programmer defined datatype identifier is then used in a program to declare variables.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fresherstimes.com/tutorial/c-programming/c-language-data-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

