有个逻辑运算的题目
有个逻辑运算的题目请教大家
#include "stdafx.h"
#define WS_CAPTION 0x00000001
#define WS_BORDER 0x00800000
#define WS_CHILD 0x00200000
#define WS_VISIBLE 0x00004000
int main()
{
int style=WS_CAPTION|WS_BORDER|WS_CHILD|WS_VISIBLE;
//请写一条语句,去掉style中的WS_BORDER特征项
return 0;
}
1、style初始化的值是0x00a04001 吗? 它怎么体现出具有了以上4个特征的?
2、如何去掉style中的WS_BORDER特征项?
------解决方案--------------------
1、style初始化的值是0x00a04001 吗? 它怎么体现出具有了以上4个特征的?
if (style & WS_CAPTION)
具有WS_CAPTION特征
else
不具有WS_CAPTION特征
2、如何去掉style中的WS_BORDER特征项?
style &= ~WS_BORDER;
#include "stdafx.h"
#define WS_CAPTION 0x00000001
#define WS_BORDER 0x00800000
#define WS_CHILD 0x00200000
#define WS_VISIBLE 0x00004000
int main()
{
int style=WS_CAPTION|WS_BORDER|WS_CHILD|WS_VISIBLE;
//请写一条语句,去掉style中的WS_BORDER特征项
return 0;
}
1、style初始化的值是0x00a04001 吗? 它怎么体现出具有了以上4个特征的?
2、如何去掉style中的WS_BORDER特征项?
------解决方案--------------------
1、style初始化的值是0x00a04001 吗? 它怎么体现出具有了以上4个特征的?
if (style & WS_CAPTION)
具有WS_CAPTION特征
else
不具有WS_CAPTION特征
2、如何去掉style中的WS_BORDER特征项?
style &= ~WS_BORDER;