I am developing a study project. It includes registration, authorization, and saving records of customer. In my project reading the information from file using fstream is not working so I use FILE\* method. And I need to clear all data in file to rewrite it for saving new records.

There is a question. How to clear it? I found a lot of examples how to do this but all of their are for using fstream. Is it real to do using FILE\* ?

Here is some code:

```
FILE* Usrs = fopen("Users.dat", "rb");
        StructForReg Array[100];
        StructForReg Perenos;
        int i = 0;
        while (!!(feof(Usrs) == 0))
        {
            fread(&Perenos, sizeof(StructForReg), 15, Usrs);
            Array[i] = Perenos;
            i += 1;
        }
        fclose(Usrs);
//here must be a code with clearing and rewriting

```