I am trying to output numbers in an array called memory in this format: +0005
(given that that location in the array holds the integer 5).
My output is basically this: cout << setfill('0') << setw(4) << memory[i];
The problem is when I try to incorporate the showpos manipulator like so:
cout << showpos << setfill('0') << setw(4) << memory[i];
The output looks like this: 000+5 or 00+5, I can't exactly remember.
Either way that's not the output I want. Any suggestions?
Thanks.
Can you post your entire code in code brackets so we can better understand the context?
Last edited on