void uniq_i() { //file_name1=fopen(params[2],"r"); if ( file_name1 != NULL ) { fgets(prev1,199,file_name1); while ( fgets ( line, 199, file_name1 ) != NULL ) /* read a line */ { if(!strcmp(prev1,line)) { printf("%s", prev1); } else if(strcmp(prev1,line)) { printf("%s",line); } strcpy(prev1,line); } } else perror("Eroare"); fclose ( file_name1 ); }
// Get and print first line if (fgets(prev1, 199, file_name1) != NULL) printf("%s",prev1); while (fgets(line, 199, file_name1) != NULL) { // Print if not identical to previous one if (strcmp(line, prev1)) printf("%s",line); strcpy(prev1, line); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)