#include <iostream>
using namespace std;
struct a
{
int x:1;
int y:2;
int z:32;
};
int main()
{
a d;
cout<<&d;
d.z=d.x+d.y;
printf("%d %d %d %d\n",d.x,d.y,d.z,sizeof(d));
system("pause");
return 0;
}
#include <iostream>
using namespace std;
int main()
{
printf("%f\n", 5);
printf("%d\n", 5.01);
system("pause");
return 0;
}
#include <iostream>
#define BIT_MASK(bit_pos) (0x01<<(bit_pos))
using namespace std;
int Bit_Reset(unsigned int* val,unsigned char pos)
{
if(pos>=sizeof(unsigned int)*8)
{
return 0;
}
*val=*val & ~BIT_MASK(pos);
return 1;
}
int main()
{
unsigned int x=0xFFFFFFFF;
unsigned char y=4;
Bit_Reset(&x,y);
cout<<hex<<x<<endl;
system("pause");
return 0;
}