Thanks a lot! Been looking for fast and simple answer just like this one.
@paa0472 Жыл бұрын
Thx, man!
@unpredictabledeathrow Жыл бұрын
This is what i want to do #include<stdio.h> // Purpose : to Delete particular line into the file. void space(int n); int main(){ FILE *fp1, *fp2; int rool; char name[20]; int age; int i = 0; char ch; int delete_line; int line = 0; // write content into the data file first fp1 = fopen("some.txt","w"); do{ printf("%d student ",i+1); printf("Rool : "); scanf("%d",&rool); printf("Name : "); scanf("%s",name); printf("Age : "); scanf("%d",&age); i++; fprintf(fp1,"%d\t%s\t%d ",rool,name,age); }while(i != 3); // reading content into the data file fp1 = fopen("some.txt","r"); if(fp1 == NULL){ printf("Error : 404 "); } else{ ch = getc(fp1); while(ch != EOF){ printf("%c",ch); ch = getc(fp1); } } rewind(fp1); // taking delete line number from the user space(4); printf("Enter the delete line : "); scanf("%d",&delete_line); // open new file to write content from the pervious file without delete line . fp2 = fopen("destination.txt","w"); while((ch = getc(fp1))!= EOF){ ch = getc(fp1); if(ch == ' ') { line++; } if(line != delete_line) { // putc(ch,fp2); // fprintf(fp1,"%d\t%s\t%d ",rool,name,age); } } fclose(fp1); fclose(fp2); return 0; } void space(int n){ for(int i=0; i<=n; i++){ printf(" "); } }
@unpredictabledeathrow Жыл бұрын
Hello, sir i have a question that how can i delete a particular line in a file please sir help me
@TheBuilder Жыл бұрын
perfect
@borislawson-placca4344 Жыл бұрын
Thank you
@venkateshchintagunti4236 Жыл бұрын
This Is output?
@riiadada52833 жыл бұрын
thanks :)
@koooldud63173 жыл бұрын
I FOUND HIS CHANNEL
@akshaypandey26203 жыл бұрын
please upload/provide links for the remaining videos...... please please please
@Marcus-cf2li3 жыл бұрын
I'm confusing sir. How can I know what are 2 parameters I input in compareTo function?