Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Conversion hex to int
Conversion hex to int [message #5708] Tue, 10 October 2006 18:17 Go to next message
zaurus is currently offline  zaurus
Messages: 42
Registered: May 2006
Member
Hi!

Is there a function to convert a String which is holding a hex value (0xABCD) into the integer value? I couldn't find something suitable in Convert.h.

Thanks for any hints.
Re: Conversion hex to int [message #5710 is a reply to message #5708] Tue, 10 October 2006 20:02 Go to previous messageGo to next message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
zaurus wrote on Tue, 10 October 2006 18:17

Hi!

Is there a function to convert a String which is holding a hex value (0xABCD) into the integer value? I couldn't find something suitable in Convert.h.

Thanks for any hints.


Just have a look at "cstdlib" and you'll find "strtol" and "strtoul". Smile

Werner

Re: Conversion hex to int [message #5715 is a reply to message #5708] Wed, 11 October 2006 06:48 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
There is low-level C-like

int           ScanInt(const char *ptr, const char **endptr = NULL, int radix = 10);
int           ScanInt(const wchar *ptr, const wchar **endptr = NULL, int radix = 10);


used with radix = 16....
Re: Conversion hex to int [message #5735 is a reply to message #5708] Wed, 11 October 2006 18:37 Go to previous message
zaurus is currently offline  zaurus
Messages: 42
Registered: May 2006
Member
Thanks for the help. The ScanInt works fine.

Really a great support in this forum. I hope I can contribute in future with answers and not only questions.
Previous Topic: Value with unsigned support
Next Topic: strcmp() works with String?
Goto Forum:
  


Current Time: Fri Mar 29 02:12:22 CET 2024

Total time taken to generate the page: 0.01050 seconds