R
RB
I just recently was educated that I should be using #include <iostream>
instead of using #include <iostream.h> as I had been doing.
However, even though the education cured one strange output issue, now
with the "correct" include spec I cannot get it to show the radix base like
it used to using the "incorrect" include spec.
Very much appreciate info as to what I am still missing. Code below
==============================================
#include <windows.h>
#include <iostream> // correct include spec
using namespace std;
// #include <iostream.h> // incorrect include spec
struct _Whatever
{
DWORD dw1;
DWORD dw2;
};
int main( )
{
_Whatever* pA = new _Whatever;
pA->dw1 = 0xAAAA;
pA->dw2 = 0xBBBB;
cout.flags ( ios::hex | ios::showbase ); // want to show radix
cout << "The allocated heap address that pA and/or pA->dw1 points is " << pA
<< "\nThe allocated address that pA->dw2 points is " << &pA->dw2
<< "\nThe address of the local pA pointer (on stack) " << &pA
<< endl;
delete pA;
return 0;
}
/*------------- program output if using correct include of
#include <iostream>
using namespace std;
The allocated heap address that pA and/or pA->dw1 points is 00331C48
The allocated address that pA->dw2 points is 00331C4C
The address of the local pA pointer (on stack) 0012FF7C
// Does not showbase ???
--------------*/
/*------------- program output if using incorrect include of
#include <iostream.h>
The allocated heap address that pA and/or pA->dw1 points is 0x003308C8
The allocated address that pA->dw2 points is 0x003308CC
The address of the local pA pointer (on stack) 0x0012FF7C
// Does showbase but include is incorrect ???
-------------*/
instead of using #include <iostream.h> as I had been doing.
However, even though the education cured one strange output issue, now
with the "correct" include spec I cannot get it to show the radix base like
it used to using the "incorrect" include spec.
Very much appreciate info as to what I am still missing. Code below
==============================================
#include <windows.h>
#include <iostream> // correct include spec
using namespace std;
// #include <iostream.h> // incorrect include spec
struct _Whatever
{
DWORD dw1;
DWORD dw2;
};
int main( )
{
_Whatever* pA = new _Whatever;
pA->dw1 = 0xAAAA;
pA->dw2 = 0xBBBB;
cout.flags ( ios::hex | ios::showbase ); // want to show radix
cout << "The allocated heap address that pA and/or pA->dw1 points is " << pA
<< "\nThe allocated address that pA->dw2 points is " << &pA->dw2
<< "\nThe address of the local pA pointer (on stack) " << &pA
<< endl;
delete pA;
return 0;
}
/*------------- program output if using correct include of
#include <iostream>
using namespace std;
The allocated heap address that pA and/or pA->dw1 points is 00331C48
The allocated address that pA->dw2 points is 00331C4C
The address of the local pA pointer (on stack) 0012FF7C
// Does not showbase ???
--------------*/
/*------------- program output if using incorrect include of
#include <iostream.h>
The allocated heap address that pA and/or pA->dw1 points is 0x003308C8
The allocated address that pA->dw2 points is 0x003308CC
The address of the local pA pointer (on stack) 0x0012FF7C
// Does showbase but include is incorrect ???
-------------*/