I have some problems:
- How can I erase a file?
- How can I create a random string has 8 letters?
This is my code to create a random string has 8 letters:

char    *b="";
    int        i,j;
    FILE    *f=fopen(file,"w");
    {       for(j=0;j<7;j++)

But the result is wrong
Thank you!

One huge problem is pointer b only points to a one-byte empty string which can not be expanded. Since you want a string of 8 characters then you have to allocate memory for it something like this char b[9] = {0}; . That will allocate memory for 8 characters plus a null terminator, and initialize all of them with 0.