|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Hex string to MQBYTE24 correl ID? |
« View previous topic :: View next topic » |
Author |
Message
|
cmkeller |
Posted: Wed Jan 19, 2005 7:32 am Post subject: Hex string to MQBYTE24 correl ID? |
|
|
Apprentice
Joined: 09 Jan 2005 Posts: 41 Location: Queens, NY
|
How in the world (in C/C++) can I take a character-string reoresentation of an MQ Message ID and put it on my message as the binary value for correlation ID? When the string starts with "41", I want to be able to put byte value \x41 (65 in decimal) in the first position of my correl ID. I tried atoi, that only works on decimals. I refuse to believe that the neither the C/C++ language , the Windows API, or the MQ API has nothing that will convert a hex string into its numeric value, leaving me to manually multiply my numbers by 16, and requiring me to manually translate A-F to 10-15. _________________ Chaim Mattis Keller
Shadow Financial Services Corp
ckeller@shadowfinancial.com |
|
Back to top |
|
 |
Nigelg |
Posted: Wed Jan 19, 2005 8:13 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
Try strtol in C.
Quote: |
long strtol (String, EndPointer, Base)
const char *String;
char **EndPointer;
int Base;
...
The strtol subroutine returns a long integer whose value is represented by the character string to which the String parameter points. The strtol subroutine scans the string up to the first character that is inconsistent with the Base parameter. Leading white-space characters are ignored, and an optional sign may precede the digits.
|
|
|
Back to top |
|
 |
cmkeller |
Posted: Wed Jan 19, 2005 9:15 pm Post subject: |
|
|
Apprentice
Joined: 09 Jan 2005 Posts: 41 Location: Queens, NY
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|