Advertisement
Guest User

a

a guest
Jul 20th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8.     union a
  9.     {
  10.         unsigned int b;
  11.         unsigned char c[0];
  12.     };
  13.  
  14.     a m = {0x123456};
  15.     cout<<setiosflags(ios::showbase);
  16.     for(int i = 0; i < 1000; i++)
  17.         cout<<hex<<i<<" : "<<int(m.c[i])<<endl;
  18.    
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement