Skip to content

Instantly share code, notes, and snippets.

@heatd
Created February 7, 2023 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heatd/617f74fc4ab3c145fc302f714cfe333c to your computer and use it in GitHub Desktop.
Save heatd/617f74fc4ab3c145fc302f714cfe333c to your computer and use it in GitHub Desktop.
void replace_str(char *str, char c, char newc)
{
for (; *str; str++)
{
if (*str == c)
*str = newc;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment