我创建了一个程序,我需要比较两个汉字。
我使用此功能进行比较:
void fengshuitradition::comparerAuto()
{
Stockage obj_stockage;
Lunar lunar;
LunarObj* obj = lunar.solar2lunar(ui->SBSelection_4->value(), ui->SBSelection_3->value(), ui->SBSelection_2->value());
string day = obj->ganzhiDay;
for(int i = 0; i<64; i++)
{
string jourComparer = obj_stockage.appelStockage(i,1);
string jourComparer2 = obj_stockage.appelStockage(i,2);
if (day.compare(0,6,jourComparer,0,6) == 0 && day.compare(7,6,jourComparer2,0,6) == 0)
{
ui->label_0->setText(obj_stockage.appelStockage(i,0));
ui->label_1->setText(obj_stockage.appelStockage(i,1));
ui->label_2->setText(obj_stockage.appelStockage(i,2));
ui->label_3->setText(obj_stockage.appelStockage(i,3));
ui->label_4->setText(obj_stockage.appelStockage(i,4));
ui->label_5->setText(obj_stockage.appelStockage(i,5));
ui->label_6->setText(obj_stockage.appelStockage(i,6));
return;
}
}
}
我的价值是这样的股票:
const char* stockage[64][7] = {
{"1",
"\u7532 B+",
u8"\u5b50 E+ hiver",
"24 F",
"8",
"癸E-",
". ."},
// ainsi de suite
我使用了一个库:
static std::string Gan[] = {"\u7532","\u4e59","\u4e19","\u4e01","\u620a","\u5df1","\u5e9a","\u8f9b","\u58ec","\u7678"};
static std::string Zhi[] = {"\u5b50","\u4e11","\u5bc5","\u536f","\u8fb0","\u5df3","\u5348","\u672a","\u7533","\u9149","\u620c","\u4ea5"};
感谢您的帮助。