I have a delete function that will delete the specified record. In turn it will take the last record and place it in the the deleted spot. However it does not erase the record at the end, causing a duplicate entry in the videofile.txt
While the the last record is not read, because the number of movies has been decremented, it will be read when another movie is added. How to I delete this "trailing record"?
On a side note, this program deals with a struct and chars, if that helps anything.

Code:
void delete_Video(Video inventory [], int& numMovies)
{

	fstream videofile;					//	declaring
	videofile.open("a:\\videofile.txt");	//	opening file to be read

	char title_entry[31];
	int number = -1;

	if (numMovies!=0)
	{
	system("cls");
	cout << "Please enter the name of the title you would like to delete:" << endl;
    fflush(stdin);		//	Pauses screen to allow user to input
	gets(title_entry);	//	User inputs the movie title they wish to delete
	cout << endl;

	for (int deleteNum = 0; deleteNum < numMovies; deleteNum++)
	{

		if (strcmp(inventory[deleteNum].title,title_entry)==0)
		{
			number = deleteNum;

			strcpy (inventory[deleteNum].title, inventory[numMovies-1].title);
			strcpy (inventory[deleteNum].star, inventory[numMovies-1].star);
			strcpy(inventory[deleteNum].type,inventory[numMovies-1].type);
			strcpy(inventory[deleteNum].length,inventory[numMovies-1].length);
			strcpy(inventory[deleteNum].numCopies,inventory[numMovies-1].numCopies);
		    numMovies--;
		    cout << endl << strupr(title_entry) << " has been deleted from the collection." << endl << endl;
		}

	}	//	End For Loop
	
	if (number < 0)
	{
	    cout << endl << "Video title " << strupr(title_entry) << " was not found in the collection." << endl << endl;
	}		//	End Second IF Statment

	}	//	End First IF Statement

	else
	{
		cout << "There is nothing to delete." << endl << endl;
	}

}	//	End Delete function