M
mwebel
Hi,
i want to get the adress of a pointer in a string. I did so by
outputting it to a ostringstream:
------------------------------
char* ptr;
//generate adress in hex format
std:
stringstream osstr,ossbyteSize ;
//This does not work anyway
//osstr.flags((std::ios_base::fmtflags)513);
//cout <<osstr.flags()<<endl;
osstr << &ptr;
std::string value = osstr.str();
cout << value<<endl;
---------------------------------
This works actually.. just the formatting is different when compiling
under Visual Studio and g++ Linux.
MSVC: 0022FFCC
Linux: 0x22ffcc
Id like to have a 8byte string containing the adress.. even if its lead
by some zeros.
Ok i said.. lets browse the net and set the formatting flags for both.
i got the flags of the windows version (513) and tried to set it for
both..(linux showed 4098).
Now linux also shows 513.. but the output is the same.
any ideas?
is this a maybe a compiler issue? could anybody reassure me that i did
the language part right?
i want to get the adress of a pointer in a string. I did so by
outputting it to a ostringstream:
------------------------------
char* ptr;
//generate adress in hex format
std:
//This does not work anyway
//osstr.flags((std::ios_base::fmtflags)513);
//cout <<osstr.flags()<<endl;
osstr << &ptr;
std::string value = osstr.str();
cout << value<<endl;
---------------------------------
This works actually.. just the formatting is different when compiling
under Visual Studio and g++ Linux.
MSVC: 0022FFCC
Linux: 0x22ffcc
Id like to have a 8byte string containing the adress.. even if its lead
by some zeros.
Ok i said.. lets browse the net and set the formatting flags for both.
i got the flags of the windows version (513) and tried to set it for
both..(linux showed 4098).
Now linux also shows 513.. but the output is the same.
any ideas?
is this a maybe a compiler issue? could anybody reassure me that i did
the language part right?