I dont see anything different, if anything this code is easier than it was
Code:char str1[1000] = ""; char str2[1] = "^"; char str4[1001] = ""; printf("Enter : "); fgets (str1, sizeof str1, stdin); strcpy(str4,str1); strcat(str4,str2); FILE *fp = fopen ("news.dat", "a"); fprintf(fp,"%s",str4); fclose(fp);