VS中用不了strcmp啊?有没有解决办法??

VS中用不了strcmp啊?有没有解决办法??
#include
int main() {
char input[10] = { 0 };
if (strcmp_s(input, "666") == 0) {
printf("666");
}
return 0;
}

strcmp是字符串函数,使用时必须加字符串头文件,可以在第二行加上#include "string.h"

用法有问题啊 注意头文件 以及函数本身的用法 这里你其实可以百度 根据标准样例进行理解

https://www.runoob.com/cprogramming/c-function-strcmp.html

比如这里 头文件 以及函数strcmp的用法 然后再试试

加上文件头 #include <string.h>

#include<stdio.h>
#include<string>
int main() {
    char input[10] = { 0 };
    printf("please input your string\n");
    scanf("%s", input);
    if (strcmp(input, "666") == 0) {
        printf("666\n");
    }
    system("pause");
    return 0;
}

用这个代码试试,如有帮助,采纳一下