I\'m attempting to remove a character from a string in C. The problem I am having with my code is that it removes the first instance of the character from the string but als
just change
if (*ptr1 == c) *ptr1 = 0;
to
if (*ptr1 == c) continue;
as @ouah said, it breaks at the first NULL character..