Re: CString hex value to CString decimal value
- From: "David Crow [MCSD]" <david.no.spam.crow@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 22 Jul 2005 14:55:46 -0500
Simply use:
char *pEnd;
unsigned long ulNumber = strtoul("93d2f666", &pEnd, 16);
CString str;
str.Format("%x", ulNumber);
"Alex" <alex@xxxxxxxxx> wrote in message
news:42e13b25$0$751$5fc3050@xxxxxxxxxxxxxxxxxxxxxxxxxxx
> Please bare with me, I am quite new to C++.
>
> A CString contains a (large) hexadecimal string value,
> this value needs to be converted to an decimal value,
> and then put back as a string into an other CString.
>
> Data example: hexadecimal: 93d2f666 = decimal 2480076390
>
> I have googled and found a lot of solutions (hex string to int)
> but none of them returns the correct decimal value, I suspect
> that converting a large hex string to int does not work.
>
> So if someone could point me to the right direction or
> could suply a working sample, please do.
>
> TIA
>
> Alex
>
>
>
>
>
>
.
- Follow-Ups:
- References:
- CString hex value to CString decimal value
- From: Alex
- CString hex value to CString decimal value
- Prev by Date: Re: Attach() 'ing a CEdit derived class on a CDialog
- Next by Date: Re: CString hex value to CString decimal value
- Previous by thread: Re: CString hex value to CString decimal value
- Next by thread: Re: CString hex value to CString decimal value
- Index(es):
Relevant Pages
|