c 中是否有一个函数可以读取“-”之后的下一个字符?例如,检查用户是否输入了 -o 而不是 -t 或其他字符,后跟 -/
最佳答案
看起来很容易自己写:
const char * dash = strchr(the_string, '-');
if (dash) printf("The char after the dash is %c\n", dash[1]);
else printf("There was no dash in the string.\n');
关于c - 从字符串 C 读取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21899874/