String s1="aaaaa";String s2 = "bbbb";return s1.equals(s2);
若是字符串,则需要使用字符串函数了,strcmp char s1[]="abc",s2[]="xyz"; if(strcmp(s1,s2)==0) printf("%s is same as %s.",s1,s2); 也可以忽略大小写来比较,使用函数stricmp 中间的i意思是ignore case sensitive 还可以指定长度比较,strncmp,如: char s1[]="abc",s2[]="abcdefg"; if(strncmp...