Ok, where do I start?
1/ Why are practically all your variables global? That's not a very good style.
2/ There's a lot of duplicate code in your program. That makes it more difficult to read, maintain and debug.
3/
Code:
static int counter = 0;
Why
static?
4/
main does not return anything.
5/
Code:
struct personKnowledge *p; // p = (Person)
p = (struct personKnowledge *)malloc(sizeof(struct personKnowledge));
Why the dynamic allocation?
6/
Code:
fwrite(&(*p), recordLength, 1, ptrFILE);
&(*p) is just
p.
7/
Code:
number = -791673918435;
Err... what?
8/
Code:
for (i = 1; i <= totalRecordNumber; i++)
{
if (i == number)
{
Sleep(350);
printf("The record has been cleared.\n");
continue;
}
else
{
fwrite(&(*del), recordLength, 1, ptrFILE1);
}
}
This just writes the first record of the original file n-1 times into the new file.