int -> hex string
From: Poison64 (poison64_at_op.pl)
Date: 06/28/04
- Next message: Edo: "ofstream and rdstate()"
- Previous message: Thomas Matthews: "Re: C++ and ActiveX"
- Next in thread: Russell Hanneken: "Re: int -> hex string"
- Reply: Russell Hanneken: "Re: int -> hex string"
- Reply: Francis Glassborow: "Re: int -> hex string"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 28 Jun 2004 20:06:02 +0200
Hi,
I need to convert an integer into a hex string, like for
example 62 would be converted to a char array
like this one "3E". I've made an array:
char *hextable[256] = {"00","01"........."FE","FF"};
int number = 62;
char *converted = hextable[number];
But I was thinking if there is any other easier way?
converting a larger (for example 16bit) number is a
little bit harder ( number & 0x00FF, number & 0xFF
and so on ) :/
--
Poison64
http://www.poison64.prv.pl/
- Next message: Edo: "ofstream and rdstate()"
- Previous message: Thomas Matthews: "Re: C++ and ActiveX"
- Next in thread: Russell Hanneken: "Re: int -> hex string"
- Reply: Russell Hanneken: "Re: int -> hex string"
- Reply: Francis Glassborow: "Re: int -> hex string"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]