Here is a short program that generates a file in the current working directory named "backspace.txt" that contains text with backspaces in it.
Code:
#include <stdio.h>
int main(void)
{
FILE *fp = fopen("backspace.txt", "w");
if (fp == NULL)
{
perror("unable to create file backspace.txt");
return 1;
}
fprintf(fp, "This text contains b\ba\bc\bk\bs\bp\ba\bc\be\bs\n");
fclose(fp);
return 0;
}
Note that backspace is sometimes displayed as '^H' (control-h). In a hex dump, a backspace is a byte with a value of 0x08.