I don\'t know what is the problem in my code, but when I compile I get:
warning: passing arg 2 of `strcspn\' makes pointer from integer without a cast
strcspn(const char *str1, const char *str2) looks for the first instance of any characters in the second string in the first string. You are passing a character instead of a string as the second argument. You want the function strchr(const char *string, int character), which looks for a single character.