been working on this assignment creating an inventory program that will create 100 empty records, let me input data concerning each tool, enable me to list all tools, delete records for discontinued tools and update any information in the file. I think I'm off to a decent start but for some reason cant get this to compile, can anyone spot my dumb mistake.....thanks.
Code:
#include <stdio.h>

/* hardwareData structure definition */
struct hardwareData {
	int recordNum;
	char toolname[20];
    int quantity;
	double cost;

}; /* end structure hardwareData */

int main()
{
	FILE *hfPtr; /* hardware.dat file pointer */

	/* create hardwareData with default information */
	struct hardwareData hardware = { 0, "", 0,0.0 };

	/* fopen opens file; exits if file cannot be opened */
	if ((hfPtr = fopen( "hardware.dat", "rb+" )) == NULL ) {
  printf( "File could not be opened.\n" );
	} /* end if */
	else{ 
  /* require user to specift record number */
  printf( "Enter record number"
  	"( 1 to 100, 0 to end input)\n" );
  scanf( "%d", &hardware.recordNum );

  /* user enters information, which is copied into file */
  while ( hardware.recordNum != 0 ) {

  	/* user enters tool name, quantity and cost */
  	printf ( "Enter tool name, quantity, cost\n? " );

  	/* set record tool name, quantity and cost */
  	fscanf( stdin, "%s%d%f", hardware.toolname, hardware.quantity, &hardware.cost );

    /* seek position in file to user-specified record */
    fseek( hfPtr, ( hardware.recordNum - 1 ) *
    sizeof( struct hardwareData ), SEEK_SET );

  	/* write user-specified information in file */
  	fwrite( &hardware, sizeof( struct hardwareData ), 1, hfPtr );

  	/* enable user to input another record number */
  	printf( " Enter record number\n?" );
  	scanf( "%d", &hardware.recordNum );
  } /* end while */

     fclose( hfPtr ); /* fclose closes file */
	} /* end else */

  return 0; /* indicates successful termination */

}  /* end main */