发布于 2012-05-23 10:02:50
1楼
思路:
组合成一个状态字:
用位操作,
//文本数组
static char *ptext[16] =
{
"111111111111";
"222222222222"
.....
"16 16 16 16 16 16"
};
struct
{
int s1:1;
int s2:1;
......
int s16:1;
}sw;
int *p = (int*)&sw;
int sr = 0;
int i = 0;
sw.s1 = GetTagBit("A");
sw.s2 = GetTagBit(B");
......
sw.s16 = GetTagBit("P");
sr = (*p) ^ STATUS1; //STATUS1是给定的比较状态,这里做异或操作。
for(i = 0; i < 16; ++i)
{
if (sr & (1 << i))
{
printf("%s\n", ptext[i];
SetTagChar("OutText", ptext[i]);
}
}
有问题联系我: 123871020
不忘初心