Re: Binary to Hexadecimal Conversion




Thomas Schodt wrote:
lei wrote:
I made this program of converting binary to hexadecimal,
there are few errors which are new to me.

for(int count=hex.length; count>=0; count--){
if(hex[count]==10)

You are addressing the array 'hex' beyond the end.

please explain further and suggest a solution(if it's okay), thank you
so much!

.



Relevant Pages

  • Re: how to update binary field types in ADO
    ... called hex conversion? ... Is text stored as a hex array? ... Although the stream converson is a handy idea, I'm not sure how I'd go ... Have I not created an array of bytes? ...
    (microsoft.public.scripting.vbscript)
  • RE: Need Help getting values from bits.
    ... array, and convert it back to a hex value. ... Out of those 32 bits I need to get the hex value of certain ... The header information I am ... I've been able to move the data into a BitArray, but from that point I'm at ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: beginner help
    ... it may not be the ideal solution but just for the record I got it to work. ... Then used unshift to add it to the array. ... I'm really an encoding novice myself, so you might want to ask ... One possible solution, would be to convert to hex, and compare ...
    (perl.beginners)
  • Re: how to update binary field types in ADO
    ... One technique suggested by Paul Randall works in some cases. ... ' Function to convert hex string to an OctetString (byte array). ... ' Write hex string to stream. ...
    (microsoft.public.scripting.vbscript)
  • Re: sprintf syntax for string to hex
    ... > into hex array. ... a hex representation. ... Apart from that, %x denotes an argument of type unsigned int, ... use snprintfinstead of sprintf() as sprintfis inherently ...
    (comp.lang.c)