#include using namespace std; /* ******************************************************************************** Just a test project... ******************************************************************************** */ int main(int argc, char* argv[]) { char ch[2]; int itemp; union UNKNOWN{ char ch[2]; unsigned short m; }; union UNKNOWN var2; ch[0] = 10; ch[1] = 16; itemp = *(short int*)ch; cout << ch << endl; cout << "1st " << itemp << endl; itemp = ch[1]*256 + ch[0]; cout << "2nd " << itemp << endl; var2.ch[0] = ch[0]; var2.ch[1] = ch[1]; itemp = var2.m; cout << "3rd " << itemp << endl; return 0; }