I'm trying to find something of a backspace action to be done on files.
Something like:
- I for(i=0;i<n;i++) fprintf(file,"some text,\n");
- and I want to erase the last 2 characters \n and , and replace them with . (like two backspaces and a . )
I tried smthing like:
from what I guess \b deletes the next two char (i want something to delete the previous)Code:#include<stdio.h> int main() { printf("test.\n"); printf("\b\b,\n"); return 0; }