#include<stdio.h>
#include <string.h>
void main(){
char name[16] , pwd[16];
int a , b;
printf("请输入用户名:");
fgets(name,sizeof(name),stdin);
printf("请输入密码:");
fgets(pwd,sizeof(pwd),stdin);
printf("%s\n%s" ,&name , &pwd);
a = strcmp(name,"abc");
b = strcmp(pwd,"123456");
printf("%d\n",&a);
printf("%d",&b);
if(strcmp(name,"abc") == 0 && strcmp(pwd,"123456") == 0){
printf("---交换机管理系统---\n");
printf("1.登录\n");
printf("2.创建帐号\n");
printf("3.退出\n");
}else{
printf("\n用户名或者密码不正确!\n");
}
}
得到的不是0或者1 或者-1