// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>
#include <iomanip>

using namespace std;

int main(int argc, char* argv[])
{
    int nummer = 123;
    int *test = &nummer;
    cout.flags(ios::hex);
    cout << setw(8) << setfill('0') << (int)test << endl;
    return 0;
}
