'lo again,

Tis time for me to clutter up the message board with another post about things that don't work, ever...

This time I can't seem to get the code below to work properly, it'll only accept one registration, and then won't allow any further items to be input stating that the record is not empty.

Any help, suggestions, random abuse in the form of help, is always welcome..


Structure definition:

Code:
struct vehicle{
   char regno[8];
   char make[21];
   char model[21];
   char chassis[21];
   int freq;
   int count;
   }veh[50];

File being opened:

Code:
   FILE *v_file;

   if ( (v_file=fopen(FILENAME,"rb"))== NULL)
     {
      printf("\nUnable to access vehicle maintenance file");
      printf("\nFile may not exist or could be corrupted");
      printf("\n\aCreate new file? [Y/N]");
      create = toupper(getch());
      if( create != 'Y')
         {
         printf("\nUser cancelled file creation - program will end");
         getch();
         return 0;
         }
      else
         {
         printf("\n\nCreating new file....");
         if ( (v_file=fopen(FILENAME,"wb"))== NULL)
            {
            printf("\nUnable to create file - program will terminate");
            return 0;
            }
         veh->freq = 0;
         printf("\nFile created succesfully");
         printf("\n\n< Press any key to continue >");
         getch();
         }
      }

The function where the error occurs:

Code:
void Add_veh   (FILE *v_file)
  {

   char confirm;
   int pos;

   clrscr();
   printf("\n\t\t\t\tADD VEHICLE\n\n");
   printf("\n Enter vehicle registration: ");
   scanf("%s", veh->regno);
   C_SCANF;
   pos = (veh->regno[0] - 'A') * 1000 +
             (veh->regno[1] - '0') * 100 +
             (veh->regno[2] - '0') * 10 +
             (veh->regno[3] - '0') * 1;

   fseek(v_file,(pos)*STR_SIZE, SEEK_SET);
   fread(&veh,STR_SIZE,1,v_file);

   if(veh->freq != 0 )
      {
       printf("\n\n Record is not empty - unable to write");
       getch();
       return;
      }

   printf("\n Enter vehicle make: ");
   fgets(veh->make,21,stdin);
   printf("\n Enter vehicle model: ");
   fgets(veh->model,21,stdin);
   /* Goes on and on and on, asking simple questions
        to make this post shorter I'll go to the end*/
   Show_veh();
   printf("\n\n\t Is the above information correct? [Y/N] ");
   confirm = toupper(getch());
   if(confirm == 'Y')
  {
    fseek (v_file,(pos)*STR_SIZE, SEEK_SET);
    fwrite(&veh,STR_SIZE,1,v_file);
    return;
   }

   printf("\n\n Data not written to file (User intervention)\n");
   getch();
Apologies for the length of my post

But ANY help is appreciated, even if it's not about what I asked originally..

Thanks in advance...