Re: Hex writing
- Posted by Bernie Ryan <xotron at BUFFNET.NET> Apr 23, 2000
- 353 views
On Sun, 23 Apr 2000 17:19:54 -0300, Caballero Rojo <pampeano at ROCKETMAIL.COM> wrote: >Hello all, > I want to write hex numbers to a file instead of using strings > because I have to write hex numbers like 00h that can't be > represented on a string, or I don't know how. > I use: printf(id,"%s",{#4C,#00,#00,#00}) > But that prints only the L character. > Can anybody help in this? Because printf is trying to print a null terminated string. The character following #4C "L" is a zero termination amd is understood by printf to represent the end of a string. If you want to print the numeric value you would have to use %d ( decimal ) or %x ( hex ). Bernie