basics · beginner · ~15 min
Scan a format string handling the `%%` escape.
Implement int count_format_specs(const char *fmt) returning the number of conversion specifiers — a % followed by a non-% character. %% is a literal percent and does not count.
int count_format_specs(const char *fmt) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.