首页 文章
  • 1 votes
     answers
     views

    C strcmp从'char'转换为'const char *'

    你好noob程序员在这里遇到strcmp问题这是我的代码 . while (strcmp("m",wood) !=0 || strcmp("j",wood) !=0 || strcmp("o",wood) !=0){ cout << "(m for mahogany, o for oak, or p for ...
  • 1 votes
     answers
     views

    错误C2664:'strcmp':无法将参数2从'char'转换为'const char *'

    我需要有关该脚本的帮助 . BOOL Checking(LPCSTR MacID) { char ClientMacs[18] = { "11:22:33:44:55:66",}; for(int x=0; x < 10; x++) { if(!strcmp(MacID, ClientMacs[x])) { pri...
  • 1 votes
     answers
     views

    Strcmp()在“系列”中[重复]

    这个问题在这里已有答案: How to do scanf for single char in C 11个答案 compare a character on a char array by using strcmp 2个答案 我想比较一些字符串,但不幸的是我没有找到任何正确的方法来做到这一点 . 背后的想法是要求键盘输入,读取变量,一个符号,如果它是“y”或“n”(显然是“是”或“否”...
  • 0 votes
     answers
     views

    使用strtok()和strcmp()的分段错误错误

    我正在尝试制作一个简单的C程序,它逐行检查Linux密码文件,搜索以命令行参数提供的用户名开头的行 . 每行包含由冒号分隔的几个标记 . 第一个令牌是用户名,第二个是无关紧要,第三个是需要打印的用户ID(UID)号,第四个令牌是需要打印的组ID号(GID) . 使用一些打印测试并在线搜索解决方案,我认为我的令牌变量在将其分配给我的第一个strtok调用后仍为NULL(此时令牌的printf不打印任...
  • 0 votes
     answers
     views

    Pin Challenge Response Sysem

    #include <iostream> #include <ctime> #include <cstdlib> #include <string.h> using namespace std; int main() { char pin[6]; //character array to allow for ease of input int ra...

热门问题