怎样修改才可以使用strcmp()函数呢?

typedef struct
{
    char name[20];
    char secret[10];
}Client;//用户信息

Client *user = (Client*)malloc(sizeof(Client));//动态内存分配;
...
void Login(Client client[])//登陆
{
    char clientNam[20];// = "0";//定义账号 密码
    char clientsecret[20];// = "0";
    char ch3={0};

    printf("请输入您的姓名: \n");
    scanf("%s", clientNam);
    printf("请输入您的密码: \n");
    scanf("%s", clientsecret);

    if ((strcmp(clientNam, user->name) == 0) && (strcmp(clientsecret, user->secret) == 0))
    {
        ...
    }
}

if (strncmp(clientNam, user->name, 20) == 0 && strncmp(clientsecret, user->secret, 10) == 0)

加入头文件,#include<string.h>

#include<iostream>
#include<cstring>
//头文件加上就行

~ 望采纳 ~