Hello!

I am writing a really basic database using a text file in c. It is supposed to ask the user, what they want to do. If they select add a user, it add the details to the text file created. If they select to delete, it should delete that user. If they select to search, they should be able to search the text file. At last, if they select 4 the program will close.

I managed to get the first part working. But I really do not know, how to search or delete from a text file?

What should I do? I am a beginner, so with the most basic commands, if possible.

Thank you very much.

My code so far:

Code:
#include <stdio.h>
#include<stdlib.h>
#include<string.h>

typedef struct hraci
{
    char meno [40];
    char priezvisko [49];
    char vek[5];
    char vaha[30];
    char vyska[10];
} HRACI;

int main ()
{
    FILE *fb;
    int menu;
    int id_hraca = 1;
HRACI hraci [100];
        printf("Stlac 1 ak chces pridat noveho hraca\n");
        printf("Stlac 2 ak chces vymazat hraca\n");
        printf("Stlac 3 ak chces zmenit udaje hraca\n");
        printf("Stlac 4 ak chces ukoncit program\n");
        scanf ("%d",&menu);
        if (menu==1)
        {
        fb = fopen("hraci.txt","a+");
        getchar();
        printf("Zadaj meno a priezvisko\n");
        fgets(hraci[id_hraca].meno,50,stdin);
        printf("Zadaj vek hraca\n");
        getchar();
        fgets(hraci[id_hraca].vek,50,stdin);
        printf("Zadaj hmotnost hraca\n");
        getchar();
        fgets(hraci[id_hraca].vaha,50,stdin);
        printf("Zadaj vysku hraca\n");
        getchar();
        fgets(hraci[id_hraca].vyska,50,stdin);
        fprintf(fb,"Meno: %s",hraci[id_hraca].meno);
        fprintf(fb,"Vek: %s",hraci[id_hraca].vek);
        fprintf(fb,"Vaha :%s",hraci[id_hraca].vaha);
        fprintf(fb,"Vyska: %s",hraci[id_hraca].vyska);
        system ('cls');
        id_hraca++;
        }
        if(menu==2)
        {

        }
        if(menu==3)
        {

        }
        if(menu==4)
        {

        }
    fclose(fb);

}