CSV files are just text file. There's nothing special about them.
You cannot "delete" a line in a text file. You have to load the text file into memory, one line at a time, and then write the file back to a new file, skipping the line you don't want written.
Excuse the crudity of my code. It's been over a decade since I've touched C/C++:
int main(){
FILE *sourceFP, *destinationFP;
char fname[50] = "file.csv";
char idToFind[50];
char lineBuffer[4096];
sourceFP = fopen(fname, "r");
destinationFP = fopen("new.csv", "w");
printf("Enter your id card number: ");
scanf("%s", idToFind);
while( fgets(lineBuffer, 4096, sourceFP ) != NULL )
{
lineBuffer = strtok(lineBuffer, ","); if( strstr(idToFind, lineBuffer) == NULL)
{
printf("%s\n", lineBuffer);
}
}
return 0;
}