|
On Mon, Sep 9, 2019 at 7:47 AM David Gibbs <david@xxxxxxxxxxxx> wrote:
Does anyone have a routine handy (or know of an API) that will convertI think I solved my own problem.
hex characters to decimal or integer?
For example: If I have the character value 'BC614E' I would get
12345678 returned.
There is an api to do what I want ... I just misunderstood what it does.
Hi,Chamara, this might be overkill but it would also provide you a lot of flexibility in the future. I've got a short program below that uses the C libraries to convert your data to and from an integer, using a radix (or base). First, I use strtol to convert your binary string to an integer. For this, I use radix = 2. Then, I use itoa to convert that integer to a hexadecimal string using base 16.
I have a Binary representation of Hex value 003D as
00000000000000000000000000111101 this is in a 32 length Character field, I
want to represent this in 4 Character field using bit operations. can
someone guide me how to do this in free format.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.