I'm trying to do this program for school but I'm not very good at C and I'm not sure on how to do this. This program needs to read a vehicle registry with the owners name, the license plate and an additional variable to see if the registry was deleted or not. All the registries made need to be saved in a file and the user can choose to make a new registry or view them all (reading from the file I suppose) without showing the deleted ones. So I already made the base of the program, all that's left now is saving all in the file. I never worked with binary files so I have no idea how I should do this.

Any help would be greatly appreciated. Thanks.

Code:
#include<stdio.h>
#include<stdlib.h>
#define NAME_BUFFER_SIZE 80

typedef struct {
	char matricula[6];
	char proprietario[NAME_BUFFER_SIZE];
	char apagado; //iniciar a 0, != 0 = apagado
} veiculo_t;

//void inserir_registo();
//{
//}

int main()
{

int opcao = 0;
FILE *fp;
veiculo_t registo;

fp=fopen("registo.txt","ab+");

do
{
printf("Escolha uma opção:\n1- Inserir Registo\n2- Imprimir todos os registos.\n3- Apagar registo\n4- Sair\n\n");
scanf("%d", &opcao);

switch( opcao )
{
case 1: 	printf("\nIntroduza a matricula do bino1\n\n");
		scanf("%s",registo.matricula);
		printf("%s\n",registo.matricula);
		scanf("%s",registo.matricula);
		printf("%s\n",registo.matricula);
		break;
case 2: 
		printf("\nOption 2\n\n");
		break;
case 3: 
		printf("\nOption 3\n\n");
		break;
default : 	
		printf("\nBYE BYE!\n\n");
		break;
}
}while (opcao != 4);



return(0);
}