I just learned that C cannot have default arguments. Is there a way around this?
Not really. See Sourav Gosh's answer (which gives useful advice). What you could do is define a different function (with another, unique, name), e.g.
void bump_o(char*s) { bump(s, 'o'); }
and you could even define that function as static inline
in some header file.
You might also use a macro:
#define BUMP_O(S) bump((S), 'o')
but that is generally poor taste.
Notice that C and C++ are different languages. The code you show us is not correct C (see n1570).
I recommend to compile your code with all warnings and debug info (e.g. gcc -Wall -Wextra -g
with GCC), and to use a debugger (e.g. gdb
)