Re: hex error



Mark Bluemel <mark_bluemel@xxxxxxxxx> writes:

Richard wrote:
"Bill Cunningham" <nospam@xxxxxxxxxxxxx> writes:

This code compiled but I only got one hex for the J and that was it. I
want the string to be printed in hex. What did I do wrong.

#include <stdio.h>

int main()
{
char *p = "JUNK";
printf("%x\n", *p);
}

Bill


You turned your computer on too quickly and all your hex bytes got
stuck. Try dipping it in an oil bath and giving it a good shake. I find
that works.

I think his problem is that he hasn't made enough random changes yet.


Possibly. But the oil bath should help induce some Browning Motion.

--
"Avoid hyperbole at all costs, its the most destructive argument on
the planet" - Mark McIntyre in comp.lang.c
.



Relevant Pages

  • Re: Sring in Bytearray
    ... Beim Inhalt in dem String handelt es sich um ein Hexvalue das dann auch genauso im file landen soll. ... z.b Hex 40 bleibt hex 40 egal ob ASCII oder EBCDIC. ... Es wird eine länge berechnet die von int in ein entsprechendes Hex value umgewandelt werden muss das dann in eine Datei geschrieben wird. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: hex error
    ... want the string to be printed in hex. ... int main ... This prints one hex value; ... The null character at the end of the string is excluded. ...
    (comp.lang.c)
  • Re: Convert Hex String to Long/Decimals?
    ... you should use long instead of int and ToInt64 instead of ToInt32. ... >> Actually I will have a string of hexadecimals read from a xml file. ... >> I have a string of hex. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Casting hex string to int
    ... Marious Barrier wrote: ... intval($string, 0) seems to do just what I want: ... detect if it's hex, oct or dec and return the expected result. ... value is out of range for int, the max or min int value will be ...
    (comp.lang.php)
  • Re: Casting hex string to int
    ... Marious Barrier wrote: ... intval($string, 0) seems to do just what I want: ... detect if it's hex, oct or dec and return the expected result. ... value is out of range for int, the max or min int value will be ...
    (comp.lang.php)