<?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>EmbLogic &#187; Sudeep Bondwal</title>
	<atom:link href="https://www.emblogic.com/blog/author/jangrasudeep/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Tue, 03 Mar 2020 13:00:06 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>C Runtime Errors</title>
		<link>https://www.emblogic.com/blog/05/c-runtime-errors/</link>
		<comments>https://www.emblogic.com/blog/05/c-runtime-errors/#comments</comments>
		<pubDate>Mon, 12 May 2014 08:30:22 +0000</pubDate>
		<dc:creator><![CDATA[Sudeep Bondwal]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=10032</guid>
		<description><![CDATA[C runtime errors are those errors that occur during the execution of a c program and generally occur due to some illegal operation performed in the program. Examples of some illegal operations that may produce runtime errors are: Dividing a &#8230; <a href="https://www.emblogic.com/blog/05/c-runtime-errors/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>C runtime errors are those errors that occur during the execution of a c program and generally occur due to some illegal operation performed in the program.</p>
<p>Examples of some illegal operations that may produce runtime errors are:</p>
<p>    Dividing a number by zero<br />
    Trying to open a file which is not created<br />
    Lack of free memory space</p>
<p>It should be noted that occurrence of these errors may stop program execution, thus to encounter this, a program should be written such that it is able to handle such unexpected errors and rather than terminating unexpectedly, it should be able to continue operating. This ability of the program is known as robustness and the code used to make a program robust is known as guard code as it guards program from terminating abruptly due to occurrence of execution errors.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/05/c-runtime-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>file i/o (password program)</title>
		<link>https://www.emblogic.com/blog/05/file-io-password-program/</link>
		<comments>https://www.emblogic.com/blog/05/file-io-password-program/#comments</comments>
		<pubDate>Mon, 12 May 2014 08:25:30 +0000</pubDate>
		<dc:creator><![CDATA[Sudeep Bondwal]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=10027</guid>
		<description><![CDATA[#include&#60;stdio.h&#62; #include&#60;stdlib.h&#62; int main() { char *pwd=NULL; char *buff=NULL; pwd=(char *)malloc(sizeof(char)*10); buff=(char *)malloc(sizeof(char)*10); int i=0,j,ret=0; int ch; FILE *fptr=NULL; printf(&#8220;enter the password&#8221;); scanf(&#8220;%s&#8221;,pwd); fptr=fopen(&#8220;file.txt&#8221;,&#8221;r&#8221;); if(fptr&#60;0) { perror(&#8220;fopen&#8221;); return(-1); } ch=fgetc(fptr); for(j=0;j&#60;3;j++) { while(ch!=EOF) { if(ch!=&#8217;\n&#8217;) { buff[i] = ch; i++; &#8230; <a href="https://www.emblogic.com/blog/05/file-io-password-program/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>#include&lt;stdio.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
int main()<br />
{<br />
char *pwd=NULL;<br />
char *buff=NULL;<br />
pwd=(char *)malloc(sizeof(char)*10);<br />
buff=(char *)malloc(sizeof(char)*10);<br />
int i=0,j,ret=0;<br />
int ch;<br />
FILE *fptr=NULL;<br />
printf(&#8220;enter the password&#8221;);<br />
scanf(&#8220;%s&#8221;,pwd);<br />
fptr=fopen(&#8220;file.txt&#8221;,&#8221;r&#8221;);<br />
if(fptr&lt;0)<br />
{<br />
perror(&#8220;fopen&#8221;);<br />
return(-1);<br />
}<br />
ch=fgetc(fptr);<br />
for(j=0;j&lt;3;j++)<br />
{<br />
while(ch!=EOF)<br />
{<br />
if(ch!=&#8217;\n&#8217;)<br />
{<br />
buff[i] = ch;<br />
i++;<br />
}<br />
else<br />
{<br />
ret=strcmp(pwd,buff);<br />
if(ret==0)<br />
{<br />
printf(&#8220;login successfully&#8221;);<br />
exit(1);<br />
}<br />
else<br />
{<br />
i=0;<br />
}<br />
}<br />
ch=getc(fptr);<br />
}</p>
<p>if(ch==EOF)<br />
{<br />
printf(&#8220;try again\n&#8221;);<br />
printf(&#8220;enter the password&#8221;);<br />
scanf(&#8220;%s&#8221;,pwd);<br />
if(j==2)<br />
{<br />
printf(&#8220;\nyou have tried maximum time.\nyour password is blocked\n&#8221;);<br />
return (-1);<br />
}<br />
}<br />
}<br />
return 0;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/05/file-io-password-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A parent having multiple childern</title>
		<link>https://www.emblogic.com/blog/05/a-parent-having-multiple-childern/</link>
		<comments>https://www.emblogic.com/blog/05/a-parent-having-multiple-childern/#comments</comments>
		<pubDate>Mon, 12 May 2014 04:52:46 +0000</pubDate>
		<dc:creator><![CDATA[Sudeep Bondwal]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=9980</guid>
		<description><![CDATA[#include&#60;stdio.h&#62; #include&#60;sys/types.h&#62; int main() { int i,n; pid_t pid; printf(&#8220;enter the no of child\n&#8221;); scanf(&#8220;%d&#8221;,&#38;n); pid=fork(); for(i=1;i&#60;n;i++) { if(pid&#62;0) pid=fork(); } printf(&#8220;my id is-&#62;%d and my parent id is -&#62; %d\n&#8221;,getpid(),getppid()); return 0; }]]></description>
				<content:encoded><![CDATA[<p>#include&lt;stdio.h&gt;<br />
#include&lt;sys/types.h&gt;<br />
int main()<br />
{<br />
int i,n;<br />
pid_t pid;<br />
printf(&#8220;enter the no of child\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;n);<br />
pid=fork();<br />
for(i=1;i&lt;n;i++) { if(pid&gt;0)<br />
pid=fork();<br />
}<br />
printf(&#8220;my id is-&gt;%d and my parent id is -&gt; %d\n&#8221;,getpid(),getppid());<br />
return 0;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/05/a-parent-having-multiple-childern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ipc server using pipes</title>
		<link>https://www.emblogic.com/blog/05/ipc-server-using-pipes/</link>
		<comments>https://www.emblogic.com/blog/05/ipc-server-using-pipes/#comments</comments>
		<pubDate>Sun, 11 May 2014 11:44:38 +0000</pubDate>
		<dc:creator><![CDATA[Sudeep Bondwal]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=9971</guid>
		<description><![CDATA[#include&#8221;header.h&#8221; #include&#8221;declaration.h&#8221; int main() { int ret,len,sum,sub,n; int r11[2]; int r12[2]; int r21[2]; int r22[2]; int p11[2]; int p12[2]; int p21[2]; int p22[2]; struct req rq; char br11[4],br12[4],br21[4],br22[4],bp11[4],bp12[4],bp21[4],bp22[4]; ret=pipe(r11); ret=pipe(r21); ret=pipe(r22); ret=pipe(r12); ret=pipe(p11); ret=pipe(p21); ret=pipe(p22); ret=pipe(p12); ret=fork(); if(ret == 0) &#8230; <a href="https://www.emblogic.com/blog/05/ipc-server-using-pipes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>#include&#8221;header.h&#8221;<br />
#include&#8221;declaration.h&#8221;</p>
<p>int main()<br />
{<br />
int ret,len,sum,sub,n;<br />
int r11[2];<br />
int r12[2];<br />
int r21[2];<br />
int r22[2];<br />
int p11[2];<br />
int p12[2];<br />
int p21[2];<br />
int p22[2];<br />
struct req rq;<br />
char br11[4],br12[4],br21[4],br22[4],bp11[4],bp12[4],bp21[4],bp22[4];<br />
ret=pipe(r11);<br />
ret=pipe(r21);<br />
ret=pipe(r22);<br />
ret=pipe(r12);<br />
ret=pipe(p11);<br />
ret=pipe(p21);<br />
ret=pipe(p22);<br />
ret=pipe(p12);<br />
ret=fork();<br />
if(ret == 0)<br />
{<br />
sprintf(br11,&#8221;%d&#8221;,r11[1]);<br />
sprintf(br12,&#8221;%d&#8221;,r12[0]);<br />
execl(&#8220;./rq1&#8243;,&#8221;./rq1&#8243;,br11,br12,NULL);<br />
}<br />
else<br />
{<br />
len=sizeof(struct req);<br />
read(r11[0],&amp;rq,len);<br />
printf(&#8220;rq.a=%d\nrq.b=%d\nrq.c=%c\n&#8221;,rq.a,rq.b,rq.opr);<br />
ret=fork();<br />
if(ret == 0)<br />
{<br />
sprintf(bp11,&#8221;%d&#8221;,p11[0]);<br />
sprintf(bp12,&#8221;%d&#8221;,p12[1]);<br />
execl(&#8220;./pq1&#8243;,&#8221;./pq1&#8243;,bp11,bp12,NULL);<br />
}<br />
else<br />
{<br />
write(p11[1],&amp;rq,len);<br />
read(p12[0],&amp;sum,4);<br />
printf(&#8220;\nserver &#8230;.sum =%d\n&#8221;,sum);<br />
}<br />
ret=write(r12[1],&amp;sum,4);<br />
printf(&#8220;written for server at rq1=%d&#8221;,ret);<br />
ret=fork();<br />
if(ret==0)<br />
{<br />
sprintf(br21,&#8221;%d&#8221;,r21[1]);<br />
sprintf(br22,&#8221;%d&#8221;,r22[0]);<br />
execl(&#8220;./rq2&#8243;,&#8221;./rq2&#8243;,br21,br22,NULL);<br />
}<br />
else<br />
{<br />
len=sizeof(struct req);<br />
read(r21[0],&amp;rq,len);<br />
printf(&#8220;rq.a=%d\nrq.b=%d\nrq.c=%c\n&#8221;,rq.a,rq.b,rq.opr);<br />
ret=fork();<br />
if(ret == 0)<br />
{<br />
sprintf(bp21,&#8221;%d&#8221;,p21[0]);<br />
sprintf(bp22,&#8221;%d&#8221;,p22[1]);<br />
execl(&#8220;./pq2&#8243;,&#8221;./pq2&#8243;,bp21,bp22,NULL);<br />
}<br />
else<br />
{<br />
write(p21[1],&amp;rq,len);<br />
read(p22[0],&amp;sub,4);<br />
printf(&#8220;\nserver &#8230;.sub =%d\n&#8221;,sum);<br />
ret=write(r22[1],&amp;sub,4);<br />
}<br />
}<br />
return 0;<br />
}<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/05/ipc-server-using-pipes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ipc server using fifo</title>
		<link>https://www.emblogic.com/blog/05/ipc-server-using-fifo/</link>
		<comments>https://www.emblogic.com/blog/05/ipc-server-using-fifo/#comments</comments>
		<pubDate>Sun, 11 May 2014 11:41:38 +0000</pubDate>
		<dc:creator><![CDATA[Sudeep Bondwal]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=9965</guid>
		<description><![CDATA[#include&#8221;header.h&#8221; #include&#8221;declaration.h&#8221; int main() { int r1,p1,ret,len; struct req res; ret=access(&#8220;rq1&#8243;,F_OK); if(ret &#60;0) { ret=mkfifo(&#8220;rq1&#8243;,0777); if(ret&#60;0) { perror(&#8220;mkfifo&#8221;); return -1; } } ret=access(&#8220;rq2&#8243;,F_OK); if(ret &#60;0) { ret=mkfifo(&#8220;rq2&#8243;,0777); if(ret&#60;0) { perror(&#8220;mkfifo&#8221;); return -1; } } ret=access(&#8220;rq3&#8243;,F_OK); if(ret &#60;0) { ret=mkfifo(&#8220;rq3&#8243;,0777); if(ret&#60;0) &#8230; <a href="https://www.emblogic.com/blog/05/ipc-server-using-fifo/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>#include&#8221;header.h&#8221;<br />
#include&#8221;declaration.h&#8221;</p>
<p>int main()<br />
{<br />
int r1,p1,ret,len;<br />
struct req res;<br />
ret=access(&#8220;rq1&#8243;,F_OK);<br />
if(ret &lt;0)<br />
{<br />
ret=mkfifo(&#8220;rq1&#8243;,0777);<br />
if(ret&lt;0)<br />
{<br />
perror(&#8220;mkfifo&#8221;);<br />
return -1;<br />
}<br />
}<br />
ret=access(&#8220;rq2&#8243;,F_OK);<br />
if(ret &lt;0)<br />
{<br />
ret=mkfifo(&#8220;rq2&#8243;,0777);<br />
if(ret&lt;0)<br />
{<br />
perror(&#8220;mkfifo&#8221;);<br />
return -1;<br />
}<br />
}<br />
ret=access(&#8220;rq3&#8243;,F_OK);<br />
if(ret &lt;0)<br />
{<br />
ret=mkfifo(&#8220;rq3&#8243;,0777);<br />
if(ret&lt;0)<br />
{<br />
perror(&#8220;mkfifo&#8221;);<br />
return -1;<br />
}<br />
}<br />
ret=access(&#8220;pq1&#8243;,F_OK);<br />
if(ret &lt;0)<br />
{<br />
ret=mkfifo(&#8220;pq1&#8243;,0777);<br />
if(ret&lt;0)<br />
{<br />
perror(&#8220;mkfifo&#8221;);<br />
return -1;<br />
}<br />
}<br />
ret=access(&#8220;pq2&#8243;,F_OK);<br />
if(ret &lt;0)<br />
{<br />
ret=mkfifo(&#8220;pq2&#8243;,0777);<br />
if(ret&lt;0)<br />
{<br />
perror(&#8220;mkfifo&#8221;);<br />
return -1;<br />
}<br />
}<br />
ret=access(&#8220;pq3&#8243;,F_OK);<br />
if(ret &lt;0)<br />
{<br />
ret=mkfifo(&#8220;pq3&#8243;,0777);<br />
if(ret&lt;0)<br />
{<br />
perror(&#8220;mkfifo&#8221;);<br />
return -1;<br />
}<br />
}<br />
/////1st requesting client//////////////////<br />
r1=open(&#8220;rq1&#8243;,O_RDONLY);<br />
len=sizeof(struct req);<br />
ret=read(r1,&amp;res,len);</p>
<p>printf(&#8220;res.a=%d\nres.b=%d\nres.opr=%c\n&#8221;,res.a,res.b,res.opr);<br />
///////1st processing client/////////////////<br />
p1=open(&#8220;pq1&#8243;,O_WRONLY);<br />
write(p1,&amp;res,len);<br />
close(p1);<br />
p1=open(&#8220;pq1&#8243;,O_RDONLY);<br />
read(p1,&amp;res,len);<br />
printf(&#8220;at server sum is = %d\n&#8221;,res.result);<br />
close(r1);<br />
r1=open(&#8220;rq1&#8243;,O_WRONLY);<br />
write(r1,&amp;res,len);<br />
/////2nd requesting client//////////////////<br />
close(r1);<br />
r1=open(&#8220;rq1&#8243;,O_RDONLY);<br />
len=sizeof(struct req);<br />
ret=read(r1,&amp;res,len);<br />
printf(&#8220;ret =%d\n&#8221;,ret);</p>
<p>printf(&#8220;res.a=%d\nres.b=%d\nres.opr=%c\n&#8221;,res.a,res.b,res.opr);</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/05/ipc-server-using-fifo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linked list</title>
		<link>https://www.emblogic.com/blog/03/linked-list-3/</link>
		<comments>https://www.emblogic.com/blog/03/linked-list-3/#comments</comments>
		<pubDate>Tue, 25 Mar 2014 09:51:15 +0000</pubDate>
		<dc:creator><![CDATA[Sudeep Bondwal]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=9407</guid>
		<description><![CDATA[Each element (we will call it a node) of a list is comprising of two items &#8211; the data and a reference to the next node. The last node has a reference to null. The entry point into a linked &#8230; <a href="https://www.emblogic.com/blog/03/linked-list-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Each element (we will call it a <strong>node</strong>) of a list is comprising of two items &#8211; the data and a reference to the next node. The last node has a reference to <span style="color: blue">null</span>. The entry point into a linked list is called the <strong>head </strong>of the list. It should be noted that head is not a separate node, but the reference to the first node. If the list is empty then the head is a null reference.</p>
<p>A linked list is a dynamic data structure. The number of nodes in a list is not fixed and can grow and shrink on demand. Any application which has to deal with an unknown number of objects will need to use a linked list.</p>
<p>One disadvantage of a linked list against an array is that it does not allow direct access to the individual elements. If you want to access a particular item then you have to start at the head and follow the references until you get to that item.</p>
<p>Another disadvantage is that a linked list uses more memory compare with an array &#8211; we extra 4 bytes (on 32-bit CPU) to store a reference to the next node.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/linked-list-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>To print master array</title>
		<link>https://www.emblogic.com/blog/03/to-print-master-array/</link>
		<comments>https://www.emblogic.com/blog/03/to-print-master-array/#comments</comments>
		<pubDate>Sat, 22 Mar 2014 12:00:23 +0000</pubDate>
		<dc:creator><![CDATA[Sudeep Bondwal]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=9260</guid>
		<description><![CDATA[#include&#60;stdio.h&#62; #include&#60;string.h&#62; #include&#60;fcntl.h&#62; int main() { int i,j,fd,len,maslen=1; char arr[100]={0}; char masterarr[25]={0}; fd=open(&#8220;add.c&#8221;,O_RDONLY); i=0; while(read(fd,&#38;arr[i],1)) i++; len=strlen(arr); for(i=0;i&#60;len;i++) { for(j=0;j&#60;maslen;j++) { if(j+1==maslen) { masterarr[j]=arr[i]; maslen++; break; } else { if(masterarr[j]==arr[i]) break; } } } printf(&#8220;masterarr=%s\n&#8221;,masterarr); return 0; }]]></description>
				<content:encoded><![CDATA[<p>#include&lt;stdio.h&gt;<br />
#include&lt;string.h&gt;<br />
#include&lt;fcntl.h&gt;<br />
int main()<br />
{<br />
int i,j,fd,len,maslen=1;<br />
char arr[100]={0};<br />
char masterarr[25]={0};<br />
fd=open(&#8220;add.c&#8221;,O_RDONLY);<br />
i=0;<br />
while(read(fd,&amp;arr[i],1))<br />
i++;<br />
len=strlen(arr);<br />
for(i=0;i&lt;len;i++)<br />
{<br />
for(j=0;j&lt;maslen;j++)<br />
{<br />
if(j+1==maslen)<br />
{<br />
masterarr[j]=arr[i];<br />
maslen++;<br />
break;<br />
}</p>
<p>else<br />
{<br />
if(masterarr[j]==arr[i])<br />
break;</p>
<p>}</p>
<p>}</p>
<p>}<br />
printf(&#8220;masterarr=%s\n&#8221;,masterarr);<br />
return 0;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/to-print-master-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
