ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » How to read "Message Identifier Bytes" in C code?

Post new topic  Reply to topic Goto page Previous  1, 2, 3
 How to read "Message Identifier Bytes" in C code? « View previous topic :: View next topic » 
Author Message
gbaddeley
PostPosted: Sun Nov 06, 2011 2:59 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

rekarm01 wrote:
gbaddeley wrote:
The sprintf needs format specification "%02X" to print 2 hex bytes per array entry.

"%.2X" will probably work better.


I haven't tried "%.2X" but "%02X" works perfectly for me on Windows, z/OS and a range of UNIX platforms and compilers.
_________________
Glenn
Back to top
View user's profile Send private message
rekarm01
PostPosted: Mon Nov 07, 2011 1:49 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

gbaddeley wrote:
I haven't tried "%.2X" but "%02X" works perfectly for me on Windows, z/OS and a range of UNIX platforms and compilers.

Hmm ... so it does. For "%X", either specification will work just as well:
  • "%02X" prints a minimum of two characters, padding with leading zeroes as needed.
  • "%.2X" prints a minimum of two digits, padding with leading zeroes as needed.
  • For "%X", there is no sign character, decimal point, or fractional part, so the number of characters is the same as the number of digits.
But this only takes care of adding a leading zero to single-digit hexadecimal values. In order to get rid of the extraneous "FFFFFF" characters ...

mvic wrote:
unsigned char is probably needed
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3 Page 3 of 3

MQSeries.net Forum Index » General IBM MQ Support » How to read "Message Identifier Bytes" in C code?
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.