This message was edited by IDK at 2005-8-12 11:55:9
This message was edited by IDK at 2005-8-12 11:54:22
:
Thank you Niklas,
: But how can I accomplish this?
: for instance I have this code...
:
: double doubleValue = some_double_value;
: // I get the address of doubleValue
: double *doubleValueRef = &doubleValue;
:
: ...then, how can I make the access?
: Regards Reivaj
:
Like this:
double doubleValue = some_double_value;
byte *doubleAddress = &doubleValue;
// at the red arrow ^ I want to get the address of doubleValue to doubleaddress
//make binary...
for(int i = 0; i<sizeof(double); i++) {
for(int p = 7; p > 0; p++) {
cout << (Math.Pow(2,p) & &doubleAddress)/Math.Pow(2,p);
} //right at the red arrow ^ I want to get the value that's stored at the address doubleAddress.
doubleAddress++;
}
This should be platform independent and you wont need any headers,
except math.h.
I'm not sure of how addresses are working in C/C++... That's why I wrote it in english first.
I hope you got how I've denscibed it here. I usually programming in
assembly and there it's all clear, but here I don't know...
Niklas Ulvinge aka IDK