<?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; Sweety Hooda</title>
	<atom:link href="https://www.emblogic.com/blog/author/sweety22111993/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></title>
		<link>https://www.emblogic.com/blog/06/10584/</link>
		<comments>https://www.emblogic.com/blog/06/10584/#comments</comments>
		<pubDate>Sat, 21 Jun 2014 06:49:57 +0000</pubDate>
		<dc:creator><![CDATA[Sweety Hooda]]></dc:creator>
				<category><![CDATA[Character Driver]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=10584</guid>
		<description><![CDATA[head 1.1; access; symbols; locks emblogic:1.1; strict; comment @ * @; 1.1 date 2014.06.21.06.46.49; author emblogic; state Exp; branches; next ; desc @create a module.. using module_init and module_exit system calls.. then insert and delete the module from the list &#8230; <a href="https://www.emblogic.com/blog/06/10584/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>head	1.1;<br />
access;<br />
symbols;<br />
locks<br />
	emblogic:1.1; strict;<br />
comment	@ * @;</p>
<p>1.1<br />
date	2014.06.21.06.46.49;	author emblogic;	state Exp;<br />
branches;<br />
next	;</p>
<p>desc<br />
@create a module..<br />
using module_init and module_exit system calls..<br />
then insert and delete the module from the list of modules..<br />
@</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/06/10584/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>introduction to semaphore and initialization of semaphore..</title>
		<link>https://www.emblogic.com/blog/05/10080/</link>
		<comments>https://www.emblogic.com/blog/05/10080/#comments</comments>
		<pubDate>Tue, 13 May 2014 11:10:55 +0000</pubDate>
		<dc:creator><![CDATA[Sweety Hooda]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=10080</guid>
		<description><![CDATA[Semaphores are a programming construct designed by E. W. Dijkstra in the late 1960s. Dijkstra&#8217;s model was the operation of railroads: consider a stretch of railroad in which there is a single track over which only one train at a &#8230; <a href="https://www.emblogic.com/blog/05/10080/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a name="ch:semaphores"></a>Semaphores are a programming construct designed by E. W. Dijkstra in the late 1960s. Dijkstra&#8217;s model was the operation of railroads: consider a stretch of railroad in which there is a single track over which only one train at a time is allowed. Guarding this track is a semaphore. A train must wait before entering the single track until the semaphore is in a state that permits travel. When the train enters the track, the semaphore changes state to prevent other trains from entering the track. A train that is leaving this section of track must again change the state of the semaphore to allow another train to enter. In the computer version, a semaphore appears to be a simple integer. A process (or a thread) waits for permission to proceed by waiting for the integer to become 0. The signal if it proceeds signals that this by performing incrementing the integer by 1. When it is finished, the process changes the semaphore&#8217;s value by subtracting one from it.</p>
<p>&nbsp;</p>
<ul>
<li style="text-align: center">Initializing a Semaphore Set<a name="SECTION002610000000000000000"></a></li>
</ul>
<p>The function <tt>semget()</tt> initializes or gains access to a semaphore. It is prototyped by:</p>
<pre>int semget(key_t key, int nsems, int semflg);
</pre>
<p>When the call succeeds, it returns the semaphore ID (<tt>semid</tt>).</p>
<p>The <tt>key</tt> argument is a access value associated with the semaphore ID.</p>
<p>The <tt>nsems</tt> argument specifies the number of elements in a semaphore array. The call fails when <tt>nsems</tt> is greater than the number of elements in an existing array; when the correct count is not known, supplying 0 for this argument ensures that it will succeed.</p>
<p>The <tt> semflg</tt> argument specifies the initial access permissions and creation control flags.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/05/10080/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>file i/o(changing  the existing password in a file )</title>
		<link>https://www.emblogic.com/blog/05/file-iochanging-the-existing-password-in-a-file/</link>
		<comments>https://www.emblogic.com/blog/05/file-iochanging-the-existing-password-in-a-file/#comments</comments>
		<pubDate>Mon, 12 May 2014 08:30:36 +0000</pubDate>
		<dc:creator><![CDATA[Sweety Hooda]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=10030</guid>
		<description><![CDATA[#include &#60;stdio.h&#62; #include &#60;string.h&#62; #include &#60;stdlib.h&#62; int main() { char *pwd=NULL; char *pwd1=NULL; int ch=0,i=0,ret,len; char *buff; pwd=malloc(sizeof(char) *10); pwd1=malloc(sizeof(char) *10); buff=malloc(sizeof(char) *10); FILE *fptr = NULL; fptr=fopen(&#8220;hello.txt&#8221;,&#8221;r+&#8221;); if(fptr == NULL) { perror(&#8220;fopen&#8221;); return -1; } else printf(&#8220;file is opened &#8230; <a href="https://www.emblogic.com/blog/05/file-iochanging-the-existing-password-in-a-file/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>#include &lt;stdio.h&gt;<br />
#include &lt;string.h&gt;<br />
#include &lt;stdlib.h&gt;<br />
int main()<br />
{<br />
char *pwd=NULL;<br />
char *pwd1=NULL;<br />
int ch=0,i=0,ret,len;<br />
char *buff;<br />
pwd=malloc(sizeof(char) *10);<br />
pwd1=malloc(sizeof(char) *10);<br />
buff=malloc(sizeof(char) *10);<br />
FILE *fptr = NULL;<br />
fptr=fopen(&#8220;hello.txt&#8221;,&#8221;r+&#8221;);<br />
if(fptr == NULL)<br />
{<br />
perror(&#8220;fopen&#8221;);<br />
return -1;<br />
}<br />
else<br />
printf(&#8220;file is opened successfully\n&#8221;);<br />
printf(&#8220;enter old password\n&#8221;);<br />
gets(pwd);<br />
ch=getc(fptr);<br />
while(ch!=EOF)<br />
{<br />
if(ch!=&#8217;\n&#8217;)<br />
{<br />
buff[i]=ch;<br />
ch=getc(fptr);<br />
i++;<br />
}<br />
else<br />
{<br />
ret=strcmp(buff,pwd);<br />
if(ret==0)<br />
{<br />
printf(&#8220;\nenter new password::&#8221;);<br />
gets(pwd);<br />
printf(&#8220;\nconfirm password::&#8221;);<br />
gets(pwd1);<br />
ret=strcmp(pwd,pwd1);<br />
while(ret!=0)<br />
{<br />
for(i=0;i&lt;3;i++)<br />
{<br />
printf(&#8220;both passwords are not same\n&#8221;);<br />
printf(&#8220;enter the confirm password again::&#8221;);<br />
gets(pwd1);<br />
ret=strcmp(pwd,pwd1);<br />
}<br />
printf(&#8220;u have tried maximum times..\n Try again after some time\n&#8221;);<br />
break;<br />
}<br />
if(ret==0)<br />
{<br />
len=strlen(pwd1);<br />
ret=fseek(fptr,-(len+1),SEEK_CUR);<br />
ret=fputs(pwd1,fptr);<br />
ret=fputc(&#8216;\n&#8217;,fptr);<br />
printf(&#8220;\npassword changed..\n&#8221;);<br />
}<br />
}<br />
else<br />
{<br />
i=0;<br />
ch=fgetc(fptr);<br />
}<br />
}<br />
}<br />
return 0;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/05/file-iochanging-the-existing-password-in-a-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>file i/o(open a file which contains passwords and login by matching  the password entered by user.)</title>
		<link>https://www.emblogic.com/blog/05/file-ioopen-a-file-which-contains-passwords-and-login-by-matching-the-password-entered-by-user/</link>
		<comments>https://www.emblogic.com/blog/05/file-ioopen-a-file-which-contains-passwords-and-login-by-matching-the-password-entered-by-user/#comments</comments>
		<pubDate>Sun, 11 May 2014 11:35:49 +0000</pubDate>
		<dc:creator><![CDATA[Sweety Hooda]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=9900</guid>
		<description><![CDATA[#include&#60;stdio.h&#62; #include&#60;string.h&#62; #include&#60;stdlib.h&#62; int main() { char *pwd=NULL; int ch=0,i=0,ret; char *buff; pwd=malloc(sizeof(char) *10); buff=malloc(sizeof(char) *10); FILE *fptr = NULL; fptr=fopen(&#8220;hello.txt&#8221;,&#8221;r+&#8221;); if(fptr == NULL) { perror(&#8220;fopen&#8221;); return -1; } else printf(&#8220;file is opened successfully\n&#8221;); printf(&#8220;enter the password\n&#8221;); gets(pwd); ch=getc(fptr); while(ch!=EOF) &#8230; <a href="https://www.emblogic.com/blog/05/file-ioopen-a-file-which-contains-passwords-and-login-by-matching-the-password-entered-by-user/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>#include&lt;stdio.h&gt;<br />
#include&lt;string.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
int main()<br />
{<br />
char *pwd=NULL;<br />
int ch=0,i=0,ret;<br />
char *buff;<br />
pwd=malloc(sizeof(char) *10);<br />
buff=malloc(sizeof(char) *10);<br />
FILE *fptr = NULL;<br />
fptr=fopen(&#8220;hello.txt&#8221;,&#8221;r+&#8221;);<br />
if(fptr == NULL)<br />
{<br />
perror(&#8220;fopen&#8221;);<br />
return -1;<br />
}<br />
else<br />
printf(&#8220;file is opened successfully\n&#8221;);<br />
printf(&#8220;enter the password\n&#8221;);<br />
gets(pwd);<br />
ch=getc(fptr);<br />
while(ch!=EOF)<br />
{<br />
if(ch!=&#8217;\n&#8217;)<br />
{<br />
buff[i]=ch;<br />
ch=getc(fptr);<br />
i++;<br />
}<br />
else<br />
{<br />
ret=strcmp(buff,pwd);<br />
if(ret==0)<br />
{<br />
printf(&#8220;login successfully..\n&#8221;);<br />
exit(0);<br />
}<br />
else<br />
{<br />
i=0;<br />
ch=fgetc(fptr);<br />
}<br />
}<br />
}<br />
if(ch==EOF)<br />
{<br />
printf(&#8220;wrong password..try again\n&#8221;);<br />
}<br />
return 0;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/05/file-ioopen-a-file-which-contains-passwords-and-login-by-matching-the-password-entered-by-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to copy a string in a array..</title>
		<link>https://www.emblogic.com/blog/03/how-to-copy-a-string-in-a-array/</link>
		<comments>https://www.emblogic.com/blog/03/how-to-copy-a-string-in-a-array/#comments</comments>
		<pubDate>Tue, 25 Mar 2014 09:52:56 +0000</pubDate>
		<dc:creator><![CDATA[Sweety Hooda]]></dc:creator>
				<category><![CDATA[Data Structures with C]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=9393</guid>
		<description><![CDATA[if we want to insert the elements of a string into a array like char a[20]=&#8221;hello&#8221;; then it will show a error&#8230; because a (array name) is a constant pointer..whose address can not be changed&#8230; and here we try to &#8230; <a href="https://www.emblogic.com/blog/03/how-to-copy-a-string-in-a-array/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>if we want to insert the elements of a string into a array like</p>
<p>char a[20]=&#8221;hello&#8221;;</p>
<p>then it will show a error&#8230;</p>
<p>because a (array name) is a constant pointer..whose address can not be changed&#8230;</p>
<p>and here we try to assign a new address of &#8216;h&#8217; to the array name..</p>
<p>so we have to use strcpy(built in func) to insert the elements of string in a array&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/how-to-copy-a-string-in-a-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linklist</title>
		<link>https://www.emblogic.com/blog/03/linklist-5/</link>
		<comments>https://www.emblogic.com/blog/03/linklist-5/#comments</comments>
		<pubDate>Tue, 25 Mar 2014 09:43:47 +0000</pubDate>
		<dc:creator><![CDATA[Sweety Hooda]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=9389</guid>
		<description><![CDATA[The following code inserts a node after an existing node in a singly linked list. The diagram shows how it works. Inserting a node before an existing one cannot be done directly; instead, one must keep track of the previous &#8230; <a href="https://www.emblogic.com/blog/03/linklist-5/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The following code inserts a node after an existing node in a singly linked list. The diagram shows how it works. Inserting a node before an existing one cannot be done directly; instead, one must keep track of the previous node and insert a node after it.</p>
<div>
<div><a href="http://en.wikipedia.org/wiki/File:CPT-LinkedLists-addingnode.svg"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/4b/CPT-LinkedLists-addingnode.svg/474px-CPT-LinkedLists-addingnode.svg.png" alt="CPT-LinkedLists-addingnode.svg" width="474" height="116" /></a></div>
</div>
<pre> <strong>function</strong> insertAfter(<em>Node</em> node, <em>Node</em> newNode) <em>// insert newNode after node</em>
     newNode.next := node.next
     node.next    := newNode</pre>
<p>Inserting at the beginning of the list requires a separate function. This requires updating <em>firstNode</em>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/linklist-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
