我正在用 C(Linux 操作系统)编程。我需要使用 rindex 来查找指定为函数参数的字符的最后一次出现。
char * rindex (const char *string, char c);
尽管我收到警告,但它工作正常:
conflicting types for built-in function ‘rindex’ [enabled by default]
但如果我包含一个string.h
标题。它给出了错误,
conflicting types for ‘rindex’
因为 rindex 被定义为,
char * rindex (const char *string, int c);
但我需要将它用作 char 并使用 string.h 进行字符串操作。有没有可能?请指导我。