What is the problem you are facing.?
Please give further detail.

WaltP commented: After 5 months, do you really think he cares now? +0

Works fine in my environment.

WaltP commented: Thanks dor resurrecting an old post for that excellent insight. -3
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
#include<graphics.h>
int citem=0,ctemp=0;

int count;
void menu();

struct item{
int icode;
char iname[30];
int quantity;
float price;
};

void modify();
struct item i;
void additem();
void display(struct item );
void delete_item();
void main()
{
char ch,another;
int num;
FILE *fp,*ft;

int code;
long int recsize;
fp= fopen("d:\\kushal\\item.dat","rb+");
if(fp==NULL)
{
fp=fopen("d:\\kushal\\item.dat","wb+");
if(fp==NULL)
    {
        printf("\nFile can not be opened");
        getch();
        exit(1);
            }
            }
    recsize=sizeof(i);
         while(1)
         {
         clrscr();
        menu();
        display(i);
        gotoxy(0,47);
        printf("\n-------------------------------------------------------------------------------");
        gotoxy(3,48);
        textcolor(7);
        cprintf("A_Add");

        gotoxy(13,48);
        textcolor(7);
        cprintf("D_Display");

        gotoxy(30,48);
        textcolor(7);
        cprintf("M_Modify");

        gotoxy(50,48);
        textcolor(7);
        cprintf("X_Delete");

        gotoxy(65,48);
        cprintf("ESC_Exit");

        gotoxy(56,48);
           //   printf("Enter your choice:");

        fflush(stdin);
        ch=getche();

        switch(ch)
        {
        case 'a':           additem();
                  /*    fseek(fp,0,SEEK_END);
                another='y';
                while((another=='Y') || (another=='y'))
            {

                clrscr();
                printf("\t\tADD ITEM\n");
                printf("\nItem code: ");
                scanf("%d",&i.icode);
                printf("\nItem name: ");
                scanf("%s",i.iname);
                printf("\nQuantity: ");
                scanf("%d",&i.quantity);
                printf("\nPrice: ");
                scanf("%f",&i.price);
                fwrite(&i,recsize,1,fp);
                rewind(fp);
                 // menu();
                 //while(fread(&i,recsize,1,fp)==1)

                 printf("\n Do u want to Add more (y/n): ");
                 fflush(stdin);
                 another=getche();
                }
                getch();
                      */
                break;
         case 'd' :
                 rewind(fp);
                 while(fread(&i,recsize,1,fp)==1)
                 printf("\n%d\t%s\t%d\t%f",i.icode,i.iname,i.quantity,i.price);
                 getch();
                 break;

         case 'm' :            modify();
                  /*
                 another='y';
                while((another=='Y') || (another=='y'))
                {
                    clrscr();
                    printf("\t\tMODIFY\n\n");
                printf("\nItem code to modify: ");
                scanf("%d",&code);
                rewind(fp);
                while(fread(&i,recsize,1,fp)==1)
                {
                if(code==i.icode)
                {
                printf("\nItem code: ");
                scanf("%d",&i.icode);
                printf("\nItem name: ");
                scanf("%s",i.iname);
                printf("\nQuantity: ");
                scanf("%d",&i.quantity);
                printf("\nPrice: ");
                scanf("%f",&i.price);
                fseek(fp,-recsize,SEEK_CUR);
                fwrite(&i,recsize,1,fp);
                break;
                    }
                      //    else{
                    //printf("\n Invalid Item code");
                       //   }
                      }
                      rewind(fp);
                 printf("\nSuccessfully Modified");
                 printf("\nDo u want to modify more record (y/n)");
                 fflush(stdin);
                 another=getche();

                     }
                     */
                    break;
         case 'x' :     delete_item();
                 /* another='y';
                  int n;
                while((another=='Y') || (another=='y'))
                {
                clrscr();
                printf("\t\tDELETE\n");
                printf("\n Enter the item code to delete: ");
                scanf("%d",&code);
                ft=fopen("d:\\kushal\\temp.dat","wb");
                rewind(fp);
                while(fread(&i,recsize,1,fp)==1)
                if(code!=i.icode){
                fwrite(&i,recsize,1,ft);
                ctemp++;
                }
                rewind(fp);
                while(fread(&i,recsize,1,fp)==1){
                citem++; ...