I use the below function to retrieve characters one by one from a FILE stream. Now the text in that file will sometimes include places holders like !first_name! within the text. What s the best way to detect when such a place holder start and when it ends so that I can swap each character between !! with proper character from another storage?
void print_chars(FILE *file) {
fseek(file, 0L, 0);
int cr;
do {
cr = fgetc(file);
putchar(cr);
} while (cr != EOF);
}