AnsweredAssumed Answered

sprintf not printing 32 bit variables correctly

Question asked by Asif Iqbal on Feb 2, 2009
Latest reply on Feb 3, 2009 by Daniel Lundin
Hello Experts
 
I am printing an unsigned 32-bit integer as following:
 
sprintf(str,"%8X", (unsigned long) sig_pow);
 
where sig_pow is defined as unigned long itself. But strangely it always prints the upper 2 bytes, i.e., most significant 4 hex characters. Anyone has some idea on what is going wrong?
 
Thanks
deneb

Outcomes