tags:

views:

207

answers:

1

In IBM ICU C library are there any string to number conversion functions. Something like atoi and atoll. I am looking for ICU function for string conversions - Cross platform, cross compiler and 32 and 64 bit version. 1. Function should throw an error. overflow or underflow. 2. I thought using "errno" -- But errno is not set in all platforms For Ex: Windows atoi. 3. strtol --> this funcion is for long data type. There is no function like strtoi.

Chandu

A: 

Use the NumberFormat class (C++) or unum.h interfaces (C) for string to number (i.e. parsing). Instead of errno, ICU uses an error code system (UErrorCode).

HTH

Steven R. Loomis