Hi
Anyone know what I'm doing wrong here?
I thought this would work to remove any of these characters from a string.
[EDIT] Code tags added.
Anyone know what I'm doing wrong here?
I thought this would work to remove any of these characters from a string.
char *strip_char(const char *str)
{
static char ret[MSL];
char *retptr;
retptr = ret;
for (; *str != '\0'; str++)
{
if(*str == '(' || *str == ')' || *str == '<' || *str == '>' || *str == '=' || *str == '-' || *str == '*')
continue;
else
{
*retptr = *str;
retptr++;
}
}
*retptr = '\0';
return ret;
}
[EDIT] Code tags added.