Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void cleans(char *s)
- {
- char *buf = (char*)malloc(strlen(s) + 1);
- size_t pos = 0;
- for(size_t i = 0; i < strlen(s); i++)
- if(s[i] != '\r' && s[i] != '\n' && s[i] != '\t') buf[pos++] = s[i];
- buf[pos] = NULL;
- strcpy(s, buf);
- free(buf);
- }
Add Comment
Please, Sign In to add comment