struct BitField{
union{
int value;
struct{
int a:8;
int b:8;
int c:16;
};
};
};
BitField MyBits;
MyBits.a = 4; //fill the internal bit structure
MyBits.b = 7;
MyBits.c = 5;
cout << MyBits.value; //print the full int representation
HKEY rkl = NULL;
RegCreateKeyEx(HKEY_CURRENT_USER, key_name, 0, NULL, 0, KEY_READ | KEY_ENUMERATE_SUB_KEYS | KEY_SET_VALUE , NULL, &rkl, NULL);
if (rkl == NULL)
return FALSE;
RegSetValueEx(rkl, "somestring", 0, REG_SZ, (unsigned char*)stringbuf, strlen(stringbuf)+1);
RegCloseKey(rkl);