Converting string Objects to Numeric Values

C++11 provides eight functions (Fig. 19.13; from the <string> header) for converting string objects to numeric values. Each function attempts to convert the beginning of its string argument to a numeric value. If no conversion can be performed, each function throws an invalid_argument exception. If the result of the conversion is out of range for the function’s return type, each function throws an out_of_range exception.

Image

Fig. 19.13. C++11 functions that convert from strings to numeric types.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.134.188