|
-
August 1st, 2002, 04:43 AM
#1
How to access a byte within a double
How can I access Bytes (8) in a double Variable. I need to access all 8 Bytes of a double. I need to convert each Byte of the double to an Hex-Value (String).
-
August 1st, 2002, 04:49 AM
#2
double value = 123.456F;
char* ptr = (char *)&value;
-
August 1st, 2002, 05:01 AM
#3
Hmmmh....
But how can I access for example the 3rd Byte?
-
August 1st, 2002, 05:21 AM
#4
double value = 123.456F;
unsigned char* ptr = (unsigned char *)&value;
// now you can treat the double as if it were any other array of char bytes
unsigned char third_byte = ptr[2];
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|