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++:
FILE *sourceFP, *destinationFP;
char fname = "file.csv";
sourceFP = fopen(fname, "r");
destinationFP = fopen("new.csv", "w");
printf("Enter your id card number: ");
while( fgets(lineBuffer, 4096, sourceFP ) != NULL )
lineBuffer = strtok(lineBuffer, ",");
if( strstr(idToFind, lineBuffer) == NULL)