HI 
 
this is the program to read all the valid records in the file , generated by chain 
hashing program, so u can c that the records from this file.
 
 
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<dos.h>
void main()
{
     /* struct {
   int sno;
   char from[10];
   char to[10];
   char subject[20];
   char message[1000];
   char date[30];
}m;*/
 struct {
  char name[20];
  char author[20];
  char category[20];
  long int bookid;
  char status;
  long int id;
  int next;
 }m;

 FILE *fm;
 int i=0;
 clrscr();
 fm=fopen("bookdb.dat","rb+");
 if(fm==NULL)
 {
  printf("cant open file");
  getch();
  exit(1);
 }
 while(fread(&m,sizeof(m),1,fm)==1)
 {
  i++;
  if(m.bookid>0)
  {
   printf("id=%ld ",m.id);
   printf("name=%s ",m.name);
   printf("author=%s ",m.author);
   printf("category=%s ",m.category);
   printf("status=%c ",m.status);
   printf("bookid=%ld ",m.bookid);
   printf("next=%d\n",m.next);
   printf("\nvalue of i%d\n",i);
   delay(1000);
  }
 }
 printf("\nvalue of i%d",i);
 getch();
}


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/EbFolB/TM
--------------------------------------------------------------------~-> 

>-----------------------------------------~-~>
CHECK THE ARCHIVE BEFORE POSTING!!!! Archive is available at 
http://www.eScribe.com/software/C-Paradise/

>------------------------------------------_->


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/C-Paradise/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to