char string[16]; int number; DWORD dwWritten; FILE *fp; HANDLE hFile; hFile=CreateFile("File.txt",GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0); WriteFile(hFile,"Line 1\n\nLine 2\n\n",strlen("Line 1\n\nLine 2\n\n"),&dwWritten,0); //write two lines to the file fp = fopen("File.txt", "r"); while (fscanf(fp, " %s %d", string, &number) > 0) { if(number == 2) { //here I want to delete this line in which number == 2 } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)