The code below to append a file is giving segmentation fault...
It takes the input but doesnt print DONE..
Plz help me out...
Code:#include <stdio.h> main() { char * ptr; printf("\nName the file: "); scanf("%s",ptr); FILE *f=fopen(ptr,"a"); if(f) { fprintf(f,"The file is appended here\n"); fclose(f); } printf("\nDONE!\n"); }