79787901

Date: 2025-10-11 08:27:43
Score: 1
Natty:
Report link

Fixing the multiple spaces case that are not stripped in the second post...

void strip_extra_spaces(char *str) {
  int i, x;

  for(i = x = 0; str[i]; ++i) {
      if(!isspace(str[x]) && !isspace(str[i]))
          str[x++] = str[i];
  }

  str[x] = '\0';
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Manuel Alonso Tajuelo