R
RB
I've got another iostream format question, since you solved my previous two.
The below small app has a commented out //<< setw(8) that fixes my output padding 0's
on just one problem ptr value, when it is put back in.
My question is, why does the preset cout width and fill work on all the other pointers
but not the last one without adding the setw(8) ?
Also I tried casting it to (int) (UINT) (DWORD) but none of them would help on the
last pointed to pE->pE_Handlr. The setw(8) did fix it though. Just curious why the others
worked without it.
Also a trivial curiosity, I have my Outlook Express news fonts set to monospacB21 but
it does not actually monospace everything? Is there anyway to actually get monospace
in Outlook?
#include <windows.h>
#include <iostream>
#include <iomanip>
using namespace std;
struct E
{
struct E *pNext;
DWORD pE_Handlr;
};
int main()
{
E *pE;
cout.flags ( ios::hex | ios::right | ios::uppercase );
cout.width(8);
cout.fill('0');
__asm // x86
{
push dword ptr FS:[0]
pop dword ptr [pE]
}
cout << " Current Block MemAddr | 1st dword Prev Blk ptr | 2nd dword Handler ptr" << endl;
while (DWORD(pE) != 0xFFFFFFFF )
{
cout << " " << pE << "h " << pE->pNext << "h " << pE->pE_Handlr << "h" << endl;
pE = pE->pNext; // << setw(8)
}
cout << " .---------'\n"
<< " The value of FFFFFFFFh is a marker for the last Block this thread" << endl;
return 0;
}
/*------------- program output WITHOUT the added setw(8) (see above commented out)
Current Block MemAddr | 1st dword Prev Blk ptr | 2nd dword Handler ptr
0012FFB0h 0012FFE0h 42C750h
0012FFE0h FFFFFFFFh 7C839AD8h
.---------'
The value of FFFFFFFFh is a marker for the last Block this thread
------------------------------------------------------------------
program output WITH the added setw(8)
Current Block MemAddr | 1st dword Prev Blk ptr | 2nd dword Handler ptr
0012FFB0h 0012FFE0h 0042CAC0h
0012FFE0h FFFFFFFFh 7C839AD8h
.---------'
The value of FFFFFFFFh is a marker for the last Block this thread
--------------*/
The below small app has a commented out //<< setw(8) that fixes my output padding 0's
on just one problem ptr value, when it is put back in.
My question is, why does the preset cout width and fill work on all the other pointers
but not the last one without adding the setw(8) ?
Also I tried casting it to (int) (UINT) (DWORD) but none of them would help on the
last pointed to pE->pE_Handlr. The setw(8) did fix it though. Just curious why the others
worked without it.
Also a trivial curiosity, I have my Outlook Express news fonts set to monospacB21 but
it does not actually monospace everything? Is there anyway to actually get monospace
in Outlook?
#include <windows.h>
#include <iostream>
#include <iomanip>
using namespace std;
struct E
{
struct E *pNext;
DWORD pE_Handlr;
};
int main()
{
E *pE;
cout.flags ( ios::hex | ios::right | ios::uppercase );
cout.width(8);
cout.fill('0');
__asm // x86
{
push dword ptr FS:[0]
pop dword ptr [pE]
}
cout << " Current Block MemAddr | 1st dword Prev Blk ptr | 2nd dword Handler ptr" << endl;
while (DWORD(pE) != 0xFFFFFFFF )
{
cout << " " << pE << "h " << pE->pNext << "h " << pE->pE_Handlr << "h" << endl;
pE = pE->pNext; // << setw(8)
}
cout << " .---------'\n"
<< " The value of FFFFFFFFh is a marker for the last Block this thread" << endl;
return 0;
}
/*------------- program output WITHOUT the added setw(8) (see above commented out)
Current Block MemAddr | 1st dword Prev Blk ptr | 2nd dword Handler ptr
0012FFB0h 0012FFE0h 42C750h
0012FFE0h FFFFFFFFh 7C839AD8h
.---------'
The value of FFFFFFFFh is a marker for the last Block this thread
------------------------------------------------------------------
program output WITH the added setw(8)
Current Block MemAddr | 1st dword Prev Blk ptr | 2nd dword Handler ptr
0012FFB0h 0012FFE0h 0042CAC0h
0012FFE0h FFFFFFFFh 7C839AD8h
.---------'
The value of FFFFFFFFh is a marker for the last Block this thread
--------------*/