<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: File Structure ( FS ) Lab Program 4 ( 6th Semester Information Science)</title>
	<atom:link href="http://www.sandeephegde.me/2009/04/05/file-structure-fs-lab-program-4-6th-semester-information-science/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sandeephegde.me/2009/04/05/file-structure-fs-lab-program-4-6th-semester-information-science/</link>
	<description>- A Man With Ambitions!</description>
	<lastBuildDate>Tue, 07 Feb 2012 06:19:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: sandeephegde</title>
		<link>http://www.sandeephegde.me/2009/04/05/file-structure-fs-lab-program-4-6th-semester-information-science/comment-page-1/#comment-221</link>
		<dc:creator>sandeephegde</dc:creator>
		<pubDate>Fri, 19 Jun 2009 13:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.pingsense.com/?p=260#comment-221</guid>
		<description>Thank you :)</description>
		<content:encoded><![CDATA[<p>Thank you <img src='http://www.sandeephegde.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sandeephegde</title>
		<link>http://www.sandeephegde.me/2009/04/05/file-structure-fs-lab-program-4-6th-semester-information-science/comment-page-1/#comment-802</link>
		<dc:creator>sandeephegde</dc:creator>
		<pubDate>Fri, 19 Jun 2009 13:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.pingsense.com/?p=260#comment-802</guid>
		<description>Thank you :)</description>
		<content:encoded><![CDATA[<p>Thank you <img src='http://www.sandeephegde.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sandeephegde</title>
		<link>http://www.sandeephegde.me/2009/04/05/file-structure-fs-lab-program-4-6th-semester-information-science/comment-page-1/#comment-844</link>
		<dc:creator>sandeephegde</dc:creator>
		<pubDate>Fri, 19 Jun 2009 13:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.pingsense.com/?p=260#comment-844</guid>
		<description>Thank you :)</description>
		<content:encoded><![CDATA[<p>Thank you <img src='http://www.sandeephegde.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shaardula</title>
		<link>http://www.sandeephegde.me/2009/04/05/file-structure-fs-lab-program-4-6th-semester-information-science/comment-page-1/#comment-220</link>
		<dc:creator>shaardula</dc:creator>
		<pubDate>Thu, 18 Jun 2009 13:08:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.pingsense.com/?p=260#comment-220</guid>
		<description>There&#039;s no question of intelligence here.it&#039;s the question of correctness.IF you do a program which is simple but not even for what was asked you get no marks.Any way see the program below to believe -i am not telling some bluff ok..(and for the link you have given it&#039;s not working..
)the below prog does both jobs -has variable length and also gives RRN access.even has sample o/p.

#include
#include
#include
#include
#include
#include

int count;
class variable
{
  struct student
  { char usn[20],name[20],sem[20],dept[20];
  };
  public: void pack();
	  void unpack();
};


void variable::pack()
{ char b[100],c[20];
  student s;
  cout&lt;&gt;s.usn&gt;&gt;s.name&gt;&gt;s.sem&gt;&gt;s.dept;
  ofstream ofile;
  ofile.open(&quot;student3.txt&quot;,ios::app);
  ofile.seekp(0,ios::end);
  long p=ofile.tellp();
  sprintf(c,&quot;&#124;%d&#124;%ld&#124;$&quot;,count+1,p);
  sprintf(b,&quot;&#124;%s&#124;%s&#124;%s&#124;%s&#124;$&quot;,s.usn,s.name,s.sem,s.dept);
  count++;
  ofile&lt;&lt;b;
  ofstream rr;
  rr.open(&quot;rr.txt&quot;,ios::app);
  rr&lt;&lt;c;
  rr.close();
  ofile.close();
}

void variable::unpack()
{ char b[100],temp[100],c[20],t[50];
  student s;
  int rrn,frrn,n=0,flag=0;
  long pos;
  cout&lt;&gt;rrn;
  ifstream rr;
  rr.open(&quot;rr.txt&quot;,ios::out);
  rr.seekg(0,ios::beg);
  ifstream ifile;
  ifile.open(&quot;student3.txt&quot;,ios::out);
  ifile.seekg(0,ios::beg);
  while(n&lt;=count)
  {
     rr.getline(c,20,&#039;$&#039;);
     sscanf(c,&quot;&#124;%d&#124;%ld&#124;$&quot;,&amp;frrn,&amp;pos,t);
     if(rrn==frrn)
     { flag=1;
       ifile.seekg(pos,ios::beg);
       cout&lt;&lt;&quot;\nDatabase: \n&quot;;
       ifile.getline(b,100,&#039;$&#039;);
       sscanf(b,&quot;&#124;%[^&#124;]&#124;%[^&#124;]&#124;%[^&#124;]&#124;%[^&#124;]&#124;$&quot;,s.usn,s.name,s.sem,s.dept,temp);
       cout&lt;&lt;s.usn&lt;&lt;&quot; &quot;&lt;&lt;s.name&lt;&lt;&quot; &quot;&lt;&lt;s.sem&lt;&lt;&quot; &quot;&lt;&lt;s.dept&lt;&lt;endl;
       break;
     }
     n++;
  }
  if(flag==0) cout&lt;&lt;&quot;\nKey not found&quot;;
  rr.close();
  ifile.close();
}

void main()
{
  variable f;
  clrscr();
  printf(&quot;\nPROGRAM TO RETRIEVE RECORDS USING RRN\n&quot;);
  char buffer[100];
  ifstream ifile;
  ifile.open(&quot;student3.txt&quot;,ios::out);
  ifile.seekg(0,ios::beg);
  while(!ifile.eof())
  { ifile.getline(buffer,100,&#039;$&#039;);
    count++;
  }
  count--;
  ifile.close();
  int ch;
  for(;;)
  { cout&lt;&gt;ch;
    switch(ch)
    {  case 1:  f.pack();
	      break;
       case 2:  f.unpack();
	      break;
       default: exit(0);

    }
  }
}

/*                             OUTPUT

 PROGRAM TO RETRIEVE RECORDS USING RRN
1: pack 2: unpack 3:Exit
Enter your choice: 1

Enter usn, name, sem, dept: 12 ram 4 is

1: pack 2: unpack 3:Exit
Enter your choice: 1

Enter usn, name, sem, dept: 23 sam 4 cse

1: pack 2: unpack 3:Exit
Enter your choice: 1

Enter usn, name, sem, dept: 1 ali 6 iem

1: pack 2: unpack 3:Exit
Enter your choice: 2

Enter record no: 3

Database:
1 ali 6 iem

1: pack 2: unpack 3:Exit
Enter your choice: 2

Enter record no: 1

Database:
12 ram 4 is

1: pack 2: unpack 3:Exit
Enter your choice: 3

*/</description>
		<content:encoded><![CDATA[<p>There&#8217;s no question of intelligence here.it&#8217;s the question of correctness.IF you do a program which is simple but not even for what was asked you get no marks.Any way see the program below to believe -i am not telling some bluff ok..(and for the link you have given it&#8217;s not working..<br />
)the below prog does both jobs -has variable length and also gives RRN access.even has sample o/p.</p>
<p>#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include</p>
<p>int count;<br />
class variable<br />
{<br />
  struct student<br />
  { char usn[20],name[20],sem[20],dept[20];<br />
  };<br />
  public: void pack();<br />
	  void unpack();<br />
};</p>
<p>void variable::pack()<br />
{ char b[100],c[20];<br />
  student s;<br />
  cout&lt;&gt;s.usn&gt;&gt;s.name&gt;&gt;s.sem&gt;&gt;s.dept;<br />
  ofstream ofile;<br />
  ofile.open(&#8220;student3.txt&#8221;,ios::app);<br />
  ofile.seekp(0,ios::end);<br />
  long p=ofile.tellp();<br />
  sprintf(c,&#8221;|%d|%ld|$&#8221;,count+1,p);<br />
  sprintf(b,&#8221;|%s|%s|%s|%s|$&#8221;,s.usn,s.name,s.sem,s.dept);<br />
  count++;<br />
  ofile&lt;&lt;b;<br />
  ofstream rr;<br />
  rr.open(&#8220;rr.txt&#8221;,ios::app);<br />
  rr&lt;&lt;c;<br />
  rr.close();<br />
  ofile.close();<br />
}</p>
<p>void variable::unpack()<br />
{ char b[100],temp[100],c[20],t[50];<br />
  student s;<br />
  int rrn,frrn,n=0,flag=0;<br />
  long pos;<br />
  cout&lt;&gt;rrn;<br />
  ifstream rr;<br />
  rr.open(&#8220;rr.txt&#8221;,ios::out);<br />
  rr.seekg(0,ios::beg);<br />
  ifstream ifile;<br />
  ifile.open(&#8220;student3.txt&#8221;,ios::out);<br />
  ifile.seekg(0,ios::beg);<br />
  while(n&lt;=count)<br />
  {<br />
     rr.getline(c,20,&#8217;$');<br />
     sscanf(c,&#8221;|%d|%ld|$&#8221;,&amp;frrn,&amp;pos,t);<br />
     if(rrn==frrn)<br />
     { flag=1;<br />
       ifile.seekg(pos,ios::beg);<br />
       cout&lt;&lt;&#8221;\nDatabase: \n&#8221;;<br />
       ifile.getline(b,100,&#8217;$');<br />
       sscanf(b,&#8221;|%[^|]|%[^|]|%[^|]|%[^|]|$&#8221;,s.usn,s.name,s.sem,s.dept,temp);<br />
       cout&lt;&lt;s.usn&lt;&lt;&#8221; &#8220;&lt;&lt;s.name&lt;&lt;&#8221; &#8220;&lt;&lt;s.sem&lt;&lt;&#8221; &#8220;&lt;&lt;s.dept&lt;&lt;endl;<br />
       break;<br />
     }<br />
     n++;<br />
  }<br />
  if(flag==0) cout&lt;&lt;&#8221;\nKey not found&#8221;;<br />
  rr.close();<br />
  ifile.close();<br />
}</p>
<p>void main()<br />
{<br />
  variable f;<br />
  clrscr();<br />
  printf(&#8220;\nPROGRAM TO RETRIEVE RECORDS USING RRN\n&#8221;);<br />
  char buffer[100];<br />
  ifstream ifile;<br />
  ifile.open(&#8220;student3.txt&#8221;,ios::out);<br />
  ifile.seekg(0,ios::beg);<br />
  while(!ifile.eof())<br />
  { ifile.getline(buffer,100,&#8217;$');<br />
    count++;<br />
  }<br />
  count&#8211;;<br />
  ifile.close();<br />
  int ch;<br />
  for(;;)<br />
  { cout&lt;&gt;ch;<br />
    switch(ch)<br />
    {  case 1:  f.pack();<br />
	      break;<br />
       case 2:  f.unpack();<br />
	      break;<br />
       default: exit(0);</p>
<p>    }<br />
  }<br />
}</p>
<p>/*                             OUTPUT</p>
<p> PROGRAM TO RETRIEVE RECORDS USING RRN<br />
1: pack 2: unpack 3:Exit<br />
Enter your choice: 1</p>
<p>Enter usn, name, sem, dept: 12 ram 4 is</p>
<p>1: pack 2: unpack 3:Exit<br />
Enter your choice: 1</p>
<p>Enter usn, name, sem, dept: 23 sam 4 cse</p>
<p>1: pack 2: unpack 3:Exit<br />
Enter your choice: 1</p>
<p>Enter usn, name, sem, dept: 1 ali 6 iem</p>
<p>1: pack 2: unpack 3:Exit<br />
Enter your choice: 2</p>
<p>Enter record no: 3</p>
<p>Database:<br />
1 ali 6 iem</p>
<p>1: pack 2: unpack 3:Exit<br />
Enter your choice: 2</p>
<p>Enter record no: 1</p>
<p>Database:<br />
12 ram 4 is</p>
<p>1: pack 2: unpack 3:Exit<br />
Enter your choice: 3</p>
<p>*/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shaardula</title>
		<link>http://www.sandeephegde.me/2009/04/05/file-structure-fs-lab-program-4-6th-semester-information-science/comment-page-1/#comment-801</link>
		<dc:creator>shaardula</dc:creator>
		<pubDate>Thu, 18 Jun 2009 13:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.pingsense.com/?p=260#comment-801</guid>
		<description>There&#039;s no question of intelligence here.it&#039;s the question of correctness.IF you do a program which is simple but not even for what was asked you get no marks.Any way see the program below to believe -i am not telling some bluff ok..(and for the link you have given it&#039;s not working..
)the below prog does both jobs -has variable length and also gives RRN access.even has sample o/p.

#include
#include
#include
#include
#include
#include

int count;
class variable
{
  struct student
  { char usn[20],name[20],sem[20],dept[20];
  };
  public: void pack();
	  void unpack();
};


void variable::pack()
{ char b[100],c[20];
  student s;
  cout&lt;&gt;s.usn&gt;&gt;s.name&gt;&gt;s.sem&gt;&gt;s.dept;
  ofstream ofile;
  ofile.open(&quot;student3.txt&quot;,ios::app);
  ofile.seekp(0,ios::end);
  long p=ofile.tellp();
  sprintf(c,&quot;&#124;%d&#124;%ld&#124;$&quot;,count+1,p);
  sprintf(b,&quot;&#124;%s&#124;%s&#124;%s&#124;%s&#124;$&quot;,s.usn,s.name,s.sem,s.dept);
  count++;
  ofile&lt;&lt;b;
  ofstream rr;
  rr.open(&quot;rr.txt&quot;,ios::app);
  rr&lt;&lt;c;
  rr.close();
  ofile.close();
}

void variable::unpack()
{ char b[100],temp[100],c[20],t[50];
  student s;
  int rrn,frrn,n=0,flag=0;
  long pos;
  cout&lt;&gt;rrn;
  ifstream rr;
  rr.open(&quot;rr.txt&quot;,ios::out);
  rr.seekg(0,ios::beg);
  ifstream ifile;
  ifile.open(&quot;student3.txt&quot;,ios::out);
  ifile.seekg(0,ios::beg);
  while(n&lt;=count)
  {
     rr.getline(c,20,&#039;$&#039;);
     sscanf(c,&quot;&#124;%d&#124;%ld&#124;$&quot;,&amp;frrn,&amp;pos,t);
     if(rrn==frrn)
     { flag=1;
       ifile.seekg(pos,ios::beg);
       cout&lt;&lt;&quot;nDatabase: n&quot;;
       ifile.getline(b,100,&#039;$&#039;);
       sscanf(b,&quot;&#124;%[^&#124;]&#124;%[^&#124;]&#124;%[^&#124;]&#124;%[^&#124;]&#124;$&quot;,s.usn,s.name,s.sem,s.dept,temp);
       cout&lt;&lt;s.usn&lt;&lt;&quot; &quot;&lt;&lt;s.name&lt;&lt;&quot; &quot;&lt;&lt;s.sem&lt;&lt;&quot; &quot;&lt;&lt;s.dept&lt;&lt;endl;
       break;
     }
     n++;
  }
  if(flag==0) cout&lt;&lt;&quot;nKey not found&quot;;
  rr.close();
  ifile.close();
}

void main()
{
  variable f;
  clrscr();
  printf(&quot;nPROGRAM TO RETRIEVE RECORDS USING RRNn&quot;);
  char buffer[100];
  ifstream ifile;
  ifile.open(&quot;student3.txt&quot;,ios::out);
  ifile.seekg(0,ios::beg);
  while(!ifile.eof())
  { ifile.getline(buffer,100,&#039;$&#039;);
    count++;
  }
  count--;
  ifile.close();
  int ch;
  for(;;)
  { cout&lt;&gt;ch;
    switch(ch)
    {  case 1:  f.pack();
	      break;
       case 2:  f.unpack();
	      break;
       default: exit(0);

    }
  }
}

/*                             OUTPUT

 PROGRAM TO RETRIEVE RECORDS USING RRN
1: pack 2: unpack 3:Exit
Enter your choice: 1

Enter usn, name, sem, dept: 12 ram 4 is

1: pack 2: unpack 3:Exit
Enter your choice: 1

Enter usn, name, sem, dept: 23 sam 4 cse

1: pack 2: unpack 3:Exit
Enter your choice: 1

Enter usn, name, sem, dept: 1 ali 6 iem

1: pack 2: unpack 3:Exit
Enter your choice: 2

Enter record no: 3

Database:
1 ali 6 iem

1: pack 2: unpack 3:Exit
Enter your choice: 2

Enter record no: 1

Database:
12 ram 4 is

1: pack 2: unpack 3:Exit
Enter your choice: 3

*/</description>
		<content:encoded><![CDATA[<p>There&#8217;s no question of intelligence here.it&#8217;s the question of correctness.IF you do a program which is simple but not even for what was asked you get no marks.Any way see the program below to believe -i am not telling some bluff ok..(and for the link you have given it&#8217;s not working..<br />
)the below prog does both jobs -has variable length and also gives RRN access.even has sample o/p.</p>
<p>#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include</p>
<p>int count;<br />
class variable<br />
{<br />
  struct student<br />
  { char usn[20],name[20],sem[20],dept[20];<br />
  };<br />
  public: void pack();<br />
	  void unpack();<br />
};</p>
<p>void variable::pack()<br />
{ char b[100],c[20];<br />
  student s;<br />
  cout&lt;&gt;s.usn&gt;&gt;s.name&gt;&gt;s.sem&gt;&gt;s.dept;<br />
  ofstream ofile;<br />
  ofile.open(&#8220;student3.txt&#8221;,ios::app);<br />
  ofile.seekp(0,ios::end);<br />
  long p=ofile.tellp();<br />
  sprintf(c,&#8221;|%d|%ld|$&#8221;,count+1,p);<br />
  sprintf(b,&#8221;|%s|%s|%s|%s|$&#8221;,s.usn,s.name,s.sem,s.dept);<br />
  count++;<br />
  ofile&lt;&lt;b;<br />
  ofstream rr;<br />
  rr.open(&#8220;rr.txt&#8221;,ios::app);<br />
  rr&lt;&lt;c;<br />
  rr.close();<br />
  ofile.close();<br />
}</p>
<p>void variable::unpack()<br />
{ char b[100],temp[100],c[20],t[50];<br />
  student s;<br />
  int rrn,frrn,n=0,flag=0;<br />
  long pos;<br />
  cout&lt;&gt;rrn;<br />
  ifstream rr;<br />
  rr.open(&#8220;rr.txt&#8221;,ios::out);<br />
  rr.seekg(0,ios::beg);<br />
  ifstream ifile;<br />
  ifile.open(&#8220;student3.txt&#8221;,ios::out);<br />
  ifile.seekg(0,ios::beg);<br />
  while(n&lt;=count)<br />
  {<br />
     rr.getline(c,20,&#8217;$');<br />
     sscanf(c,&#8221;|%d|%ld|$&#8221;,&amp;frrn,&amp;pos,t);<br />
     if(rrn==frrn)<br />
     { flag=1;<br />
       ifile.seekg(pos,ios::beg);<br />
       cout&lt;&lt;&#8221;nDatabase: n&#8221;;<br />
       ifile.getline(b,100,&#8217;$');<br />
       sscanf(b,&#8221;|%[^|]|%[^|]|%[^|]|%[^|]|$&#8221;,s.usn,s.name,s.sem,s.dept,temp);<br />
       cout&lt;&lt;s.usn&lt;&lt;&#8221; &#8220;&lt;&lt;s.name&lt;&lt;&#8221; &#8220;&lt;&lt;s.sem&lt;&lt;&#8221; &#8220;&lt;&lt;s.dept&lt;&lt;endl;<br />
       break;<br />
     }<br />
     n++;<br />
  }<br />
  if(flag==0) cout&lt;&lt;&#8221;nKey not found&#8221;;<br />
  rr.close();<br />
  ifile.close();<br />
}</p>
<p>void main()<br />
{<br />
  variable f;<br />
  clrscr();<br />
  printf(&#8220;nPROGRAM TO RETRIEVE RECORDS USING RRNn&#8221;);<br />
  char buffer[100];<br />
  ifstream ifile;<br />
  ifile.open(&#8220;student3.txt&#8221;,ios::out);<br />
  ifile.seekg(0,ios::beg);<br />
  while(!ifile.eof())<br />
  { ifile.getline(buffer,100,&#8217;$');<br />
    count++;<br />
  }<br />
  count&#8211;;<br />
  ifile.close();<br />
  int ch;<br />
  for(;;)<br />
  { cout&lt;&gt;ch;<br />
    switch(ch)<br />
    {  case 1:  f.pack();<br />
	      break;<br />
       case 2:  f.unpack();<br />
	      break;<br />
       default: exit(0);</p>
<p>    }<br />
  }<br />
}</p>
<p>/*                             OUTPUT</p>
<p> PROGRAM TO RETRIEVE RECORDS USING RRN<br />
1: pack 2: unpack 3:Exit<br />
Enter your choice: 1</p>
<p>Enter usn, name, sem, dept: 12 ram 4 is</p>
<p>1: pack 2: unpack 3:Exit<br />
Enter your choice: 1</p>
<p>Enter usn, name, sem, dept: 23 sam 4 cse</p>
<p>1: pack 2: unpack 3:Exit<br />
Enter your choice: 1</p>
<p>Enter usn, name, sem, dept: 1 ali 6 iem</p>
<p>1: pack 2: unpack 3:Exit<br />
Enter your choice: 2</p>
<p>Enter record no: 3</p>
<p>Database:<br />
1 ali 6 iem</p>
<p>1: pack 2: unpack 3:Exit<br />
Enter your choice: 2</p>
<p>Enter record no: 1</p>
<p>Database:<br />
12 ram 4 is</p>
<p>1: pack 2: unpack 3:Exit<br />
Enter your choice: 3</p>
<p>*/</p>
]]></content:encoded>
	</item>
</channel>
</rss>

