#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
int main()
{
std::string h2 = "BUS_0001";
std::string h3 = "BUS_0001";
printf(" h3 == h2: %d\n",h3 == h2);
if(h3 == h2)
{
printf("true\n");
}else{
printf("false\n");
}
printf("h3 compare h2: %d\n",h3.compare(h2));
int flag = h3.compare(h2);
if(flag == 0)
{
printf("true\n");
}else{
printf("false\n");
}
return 0;
}
h3 == h2: 1
true
h3 compare h2: 0
true
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)