<b>string_to_integer()</b>




Document: The safe-c User Guide

next integer_to_string()
up Functions
gif floating_point_to_string()

string_to_integer()

string_to_integer() accepts exactly one argument, which must be of string_type. This may be a variable or a constant. However, in practise, it is normally a variable (since, otherwise, a constant of integer_type could simply be used directly, instead of invoking string_to_integer() to process a string constant). In any case, if the argument is a variable, it will not be altered by string_to_integer().

string_to_integer() produces a return value of integer_type.

string_to_integer() examines the string given as an argument, and interprets it (if possible) as a decimal (base 10) integer number. Providing that the string can be interpreted successfully in this way, string_to_integer() will produce the internal binary representation (i.e. of integer_type) of this number as the return value. If the string cannot be interpreted in this way (e.g. "rhubarb" or "forty-two" or "3.414" etc.) then a runtime exception will be generated and the program will terminate abnormally.




Document: The safe-c User Guide

next integer_to_string()
up Functions
gif floating_point_to_string()



McMullin@eeng.dcu.ie
Fri Jan 12 12:30:02 GMT 1996