[code]put your code in here and it'll keep its formatting and syntax highlighting[/code]
Here is the problem:
One of the things I really hate about iostream is that some settings are persistent and some settings aren't.
In this case, hex and setfill are persistent, but setw isn't. This means you have to provide setw each time you provide a number.
IE, you'll want to change this:
cout << test << '\t';
To this:
cout << setw(8) << test << '\t';
Also note:
- You are working with 32-bit numbers, not 64-bit.
- You want setw(8) and not setw(4) because 32-bit numbers have 8 digits, not 4 (each byte is 2 digits)