<?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>C Questions &amp; Answers | Student Projects</title>
	<atom:link href="https://studentprojects.in/category/software-development/c-tutorials/c-faq/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Tue, 03 Jun 2014 08:36:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>What are C Tokens?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/what-are-c-tokens/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/what-are-c-tokens/#respond</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Tue, 03 Jun 2014 08:33:18 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[c programs]]></category>
		<category><![CDATA[variables]]></category>
		<category><![CDATA[c language]]></category>
		<category><![CDATA[operators]]></category>
		<category><![CDATA[keywords]]></category>
		<category><![CDATA[special characters]]></category>
		<category><![CDATA[constants]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=5397</guid>

					<description><![CDATA[<p>C programs contains many elements which are identified by the compiler as Tokens. Tokens can be categorized as 1. Keywords2. Variables3. Constants 4. Special characters 5. Operators C Token example program: int main() { int x, y, sum; x = 5, y = 10; sum = x + y; Printf (“Sum = %d \n”, sum);</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/what-are-c-tokens/">What are C Tokens?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C programs contains many elements which are identified by the compiler as Tokens. <br />Tokens can be categorized as <br />1. Keywords<br />2. Variables<br />3. Constants <br />4. Special characters <br />5. Operators</p>
<p>C Token example program:</p>
<pre lang="c" escaped="true">
int main()
{
 int x, y, sum;
 x = 5, y = 10;
 sum = x + y;
 Printf (“Sum = %d \n”, sum);
}</pre>
<p>From above program C Tokens can be categorized as follows,<br />main &#8211; identifier, which is usually used by linker as the entry point of the regular program<br />{,}, (,) – delimiter<br />int – keyword<br />x, y, sum – Variables<br />+, = &#8211; Operators<br />main, {, }, (, ), int, x, y, sum – tokens</p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/what-are-c-tokens/">What are C Tokens?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-faq/what-are-c-tokens/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What do you mean by header file in C language?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/what-do-you-mean-by-header-file-in-c-language/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/what-do-you-mean-by-header-file-in-c-language/#respond</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Fri, 30 May 2014 07:27:16 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=5390</guid>

					<description><![CDATA[<p>header file contains the library functions along with the necessary definitions and declarations. C programming language have a directive, often called include (as well as copy and import), that causes the contents of a second file to be inserted into the original file. For example #include causes the contents of a file stdio.h to be</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/what-do-you-mean-by-header-file-in-c-language/">What do you mean by header file in C language?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>header file contains the library functions along with the necessary definitions and declarations. C programming language have a directive, often called include (as well as copy and import), that causes the contents of a second file to be inserted into the original file. For example #include <stdio.h> causes the contents of a file stdio.h to be inserted into original file. </p>
<p>other examples: math.h, stdlib.h, string.h </p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/what-do-you-mean-by-header-file-in-c-language/">What do you mean by header file in C language?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-faq/what-do-you-mean-by-header-file-in-c-language/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is a global variable?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/global-variable/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/global-variable/#respond</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Tue, 14 Feb 2012 17:59:36 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[variables]]></category>
		<category><![CDATA[variable types]]></category>
		<category><![CDATA[local and global]]></category>
		<category><![CDATA[global]]></category>
		<category><![CDATA[local and global variables]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=2665</guid>

					<description><![CDATA[<p>variables that are known throughout the program and may be used by any piece of code is called a global variable. Also, they will hold their value throughout the program&#8217;s execution. Global variables can be created by declaring them outside of any function. Global variables are helpful when many functions in the program use the</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/global-variable/">What is a global variable?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>variables that are known throughout the program and may be used by any piece of code is called a global variable. Also, they will hold their value throughout the program&#8217;s execution. Global variables can be created by declaring them outside of any function.</p>
<p>Global variables are helpful when many functions in the program use the same data. Storage for global variables is in a fixed region of memory set aside for this purpose by the compiler.</p>
<p>In the following program, the variable count has been declared outside of all functions.</p>
<p>Example:</p>
<pre lang="c">#include "stdio.h"
int count;  /* count is global  */
void func1(void);
int main(void)
{
  count = 100;
  func1();
  return 0;
}
void func1(void)
{
  printf("count is %
d", count); /* will print 100 */
}</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/global-variable/">What is a global variable?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-faq/global-variable/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is a local variable?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/local-variable/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/local-variable/#respond</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Tue, 14 Feb 2012 09:47:40 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[automatic variables]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[variables]]></category>
		<category><![CDATA[variable types]]></category>
		<category><![CDATA[local and global]]></category>
		<category><![CDATA[auto]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=2661</guid>

					<description><![CDATA[<p>Variables that are declared inside a function are called local variables. Local variables can be used only by statements that are inside the block in which the variables are declared. In other words, local variables are not known outside their own code block. A block of code begins with an opening curly brace and terminates</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/local-variable/">What is a local variable?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Variables that are declared inside a function are called local variables. Local variables can be used only by statements that are inside the block in which the variables are declared. In other words, local variables are not known outside their own code block. A block of code begins with an opening curly brace and terminates with a closing curly brace.</p>
<p>Local variables exist only while the block of code in which they are declared is executing. That is, a local variable is created upon entry into its block and destroyed upon exit. Furthermore, a variable declared within one code block has no bearing on or relationship to another variable with the same name declared within a different code block.</p>
<p>Example:</p>
<pre lang="c" escaped="true">
void func1(void) 
{ 
  int y; 
  y = 10;
}
void func2(void)
{ 
  int y;
  y = -199;
}
</pre>
<p>The integer variable y is declared twice, once in func1( ) and once in func2( ). The y in func1( ) has no relationship to the y in func2( ). This is because each y is known only to the code within the block in which it is declared.</p>
<p>The C language contains the keyword auto, which can be used to declare local variables. However, since all variables are, by default, assumed to be auto, this keyword is virtually never used. </p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/local-variable/">What is a local variable?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-faq/local-variable/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is the use of sizeof() operator in C?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/sizeof-operator/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/sizeof-operator/#respond</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Tue, 07 Feb 2012 08:41:28 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[sizeof in c]]></category>
		<category><![CDATA[sizeof]]></category>
		<category><![CDATA[size of]]></category>
		<category><![CDATA[sizeof operator]]></category>
		<category><![CDATA[c opertors]]></category>
		<category><![CDATA[operators in c]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=2653</guid>

					<description><![CDATA[<p>The sizeof operator returns the size in bytes of its operand. Operand may be a variable or data type.</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/sizeof-operator/">What is the use of sizeof() operator in C?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The sizeof operator returns the size in bytes of its operand. Operand may be a variable or data type.</p>
<p>Here are few examples,</p>
<p>Example 1:</p>
<pre lang="c" escaped="true">
main()
 {
  char c;
 
  printf("%d,%d\n", sizeof c, sizeof(int)); /* returns 1, 4*/
 }
</pre>
<p>Example 2:</p>
<pre lang="c" escaped="true">
(main)
 {
	 struct 
	 {
	   int a;
	   int b;
	 }s;
	
	printf ("% d \ n", sizeof (s)); /* returns 8*/
	}
</pre>
<p>Example 3:</p>
<pre lang="c" escaped="true">
main()
 {
  short array [] = {1, 2, 3, 4, 5};

  short la = sizeof (array) / * returns 10 * /
 }
 </pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/sizeof-operator/">What is the use of sizeof() operator in C?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-faq/sizeof-operator/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>what is Void Pointer?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/void-pointer/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/void-pointer/#comments</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Thu, 19 Jan 2012 07:18:21 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[pointers in c]]></category>
		<category><![CDATA[void pointer]]></category>
		<category><![CDATA[void pointers]]></category>
		<category><![CDATA[pointer concept]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=2609</guid>

					<description><![CDATA[<p>Void pointer or generic pointer is a special type of pointer that can be pointed at objects of any data type. A void pointer is declared like a normal pointer, using the void keyword as the pointer’s type. Pointers defined using specific data type cannot hold the address of the some other type of variable</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/void-pointer/">what is Void Pointer?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Void pointer or generic pointer is a special type of pointer that can be pointed at objects of any data type. A void pointer is declared like a normal pointer, using the void keyword as the pointer’s type.</p>
<p>Pointers defined using specific data type cannot hold the address of the some other type of variable i.e., it is incorrect in C++ to assign the address of an integer variable to a pointer of type float.</p>
<p>Example: </p>
<pre lang="c" escaped="true">
float *f; //pointer of type float
int i;  //integer variable
f = &amp;i; //compilation error
</pre>
<p>The above problem can be solved by general purpose pointer called void pointer.</p>
<p>Void pointer can be declared as follows:</p>
<pre lang="c" escaped="true"> 
void *v // defines a pointer of type void
</pre>
<p>The pointer defined in this manner do not have any type associated with them and can hold the address of any type of variable.</p>
<p>Example:</p>
<pre lang="c" escaped="true">
void *v; 
int *i;
int ivar;
char chvar;
float fvar;
v = &amp;ivar; // valid
v = &amp;chvar; //valid
v = &amp;fvar; // valid
i = &amp;ivar; //valid
i = &amp;chvar; //invalid
i = &amp;fvar; //invalid
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/void-pointer/">what is Void Pointer?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-faq/void-pointer/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
		<item>
		<title>What is dangling pointer?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/dangling-pointer/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/dangling-pointer/#respond</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Tue, 17 Jan 2012 10:43:23 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[dangling pointer]]></category>
		<category><![CDATA[pointers in c]]></category>
		<category><![CDATA[dangling]]></category>
		<category><![CDATA[pointer]]></category>
		<category><![CDATA[pointers]]></category>
		<category><![CDATA[dangling pointers]]></category>
		<category><![CDATA[pointers dangling]]></category>
		<category><![CDATA[pointer concept]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=2601</guid>

					<description><![CDATA[<p>Dangling pointers and wild pointers in computer programming are pointers that do not point to a valid object of the appropriate type. In many applications memory is allocated for holding data objects. After using these objects, tha aplication will de-allocate this memory so that the memory can be re-used. In some cases the alications may</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/dangling-pointer/">What is dangling pointer?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Dangling pointers and wild pointers in computer programming are pointers that do not point to a valid object of the appropriate type.</p>
<p>In many applications memory is allocated for holding data objects. After using these objects, tha aplication will de-allocate this memory so that the memory can be re-used. In some cases the alications may use a pointer to an object whose memory is already de-allocated. This may lead to application crash or an unpredictable behavior.</p>
<p>scenarios which leads to dangling pointer</p>
<ol>
<li>Application makes use of a object after it has been released, and there by access to an invalid memory location.</li>
<li>A function returns a pointer to one of its local variables, and since this local variable is defined only fro the function, the pointer becomes invalid once the function ends.</li>
</ol>
<p>The most common result of this bug is the crash of the application or its running thread.</p>
<p><strong>Examle 1:</strong></p>
<pre lang="c" escaped="true" line="1">
#include "stdlib.h"
 
void func()
{
    char *dp = malloc(A_CONST);
    /* ... */
    free(dp);         /* dp now becomes a dangling pointer */
    /* ... */
}
</pre>
<p><strong>Example 2:</strong></p>
<pre lang="c" escaped="true" line="1">
{
   char *dp = NULL;
   /* ... */
   {
       char c;
       dp = &amp;c;
   } /* c falls out of scope */
     /* dp is now a dangling pointer */
} 
</pre>
<p><strong>Example 3:</strong></p>
<pre lang="c" escaped="true" line="1">
#include "stdio.h"

int *call();
void main(){

int *ptr;
ptr=call();

fflush(stdin);
printf("%d",*ptr);
}

int * call(){

int x=25;
++x;

return &amp;x;
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/dangling-pointer/">What is dangling pointer?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-faq/dangling-pointer/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to use Enum in C?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/enum/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/enum/#respond</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Mon, 02 Jan 2012 12:59:23 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[how to use]]></category>
		<category><![CDATA[enum]]></category>
		<category><![CDATA[enumeration]]></category>
		<category><![CDATA[example code]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=2522</guid>

					<description><![CDATA[<p>In C and C++, enum types can be used to set up collections of named integer constants. Consider a set of all days. #define Sunday 0 #define Monday 1 #define Tuesday 2 #define Wednesday 3 #define Thursday 4 #define Friday 5 #define Saturday 6 The above lines can be replaced by: enum AllDays{Sunday, Monday, Tuesday,</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/enum/">How to use Enum in C?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>In C and C++, enum types can be used to set up collections of named integer constants. Consider a set of all days. </p>
<p>#define Sunday  	 0<br />
#define Monday	 1<br />
#define Tuesday 	 2<br />
#define Wednesday 3<br />
#define Thursday	 4<br />
#define Friday  5<br />
#define Saturday	 6</p>
<p>The above lines can be replaced by:</p>
<pre lang="c" line="1">
enum AllDays{Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday};
</pre>
<p><strong>Example program:</strong></p>
<pre lang="c" line="1">
#include "stdio.h" 
int main()
{
	enum AllDays{Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday};

	AllDays aDay;
	int i = 0;
	printf("Please enter the day of the week (0 to 6)\n");
	scanf("%d",&i);
	aDay = AllDays(i);

	if(aDay == Sunday || aDay == Saturday)
	printf("It is weekend :) \n");
	else
	printf("It is not weekend :( \n");

	return 0;
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/enum/">How to use Enum in C?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-faq/enum/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to use bool in c?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/bool/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/bool/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Mon, 02 Jan 2012 12:38:55 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[bool in c]]></category>
		<category><![CDATA[bool equivalent in c]]></category>
		<category><![CDATA[boolean in c]]></category>
		<category><![CDATA[bool data type]]></category>
		<category><![CDATA[enum in c]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=2519</guid>

					<description><![CDATA[<p>There is no bool data type in C. In C99 standerd version, the boolean variable has been added as _Bool. Additionally, a new header stdbool.h has been added for compatibility reasons. This header allows programmers to use boolean types in the same way, as in C++ language. To use bool in C, we can use</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/bool/">How to use bool in c?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>There is no bool data type in C. In C99 standerd version, the boolean variable has been added as _Bool. Additionally, a new header stdbool.h has been added for compatibility reasons. This header allows programmers to use boolean types in the same way, as in C++ language.</p>
<p>To use bool in C, we can use enum as below.  </p>
<pre lang="c" line="1">
enum bool {
    false, true
};

bool value;
value = bool(0); // False
value = bool(1); // True

if(value == false)
	printf("Value is false");
else
	printf("Value is true");
</pre>
<p>Here we can use variable &#8216;value&#8217; as boolean variable. </p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/bool/">How to use bool in c?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-faq/bool/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>What is the differnce between Structure and Union?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/differnce-structure-union/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/differnce-structure-union/#comments</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Thu, 01 Sep 2011 10:29:59 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[difference]]></category>
		<category><![CDATA[structure]]></category>
		<category><![CDATA[union]]></category>
		<category><![CDATA[sizeof strucure]]></category>
		<category><![CDATA[sizeof union]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1806</guid>

					<description><![CDATA[<p>The difference between structure and union is, 1. The amount of memory required to store a structure variable is the sum of the size of all the members. On the other hand, in case of unions, the amount of memory required is always equal to that required by its largest member. 2. In case of</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/differnce-structure-union/">What is the differnce between Structure and Union?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The difference between structure and union is,<br />
1. The amount of memory required to store a structure variable is the sum of the size of all the members.<br />
On the other hand, in case of unions, the amount of memory required is always equal to that required by its largest member.</p>
<p>2. In case of structure, each member have their own memory space but In union, one block is used by all the member of the union.</p>
<p><strong>Detailed Example:</strong></p>
<pre lang="c" line="1">
struct stu
{
	char c;
	int l;
	float p;
};
</pre>
<pre lang="c" line="1">
union emp
{
	char c;
	int l;
	float p;
};
</pre>
<p><strong>In the above example size of the structure stu is 7 and size of union emp is 4. </strong></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/differnce-structure-union/">What is the differnce between Structure and Union?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-faq/differnce-structure-union/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
	</channel>
</rss>
