Converts a string to a 4-byte integer (machine dependent).
Syntax
mint rstol(char *str, mlong *val);
- str is a pointer to a null-terminated string.
- val is a pointer to an mlong value that holds the converted value.
Returns
Table 1. Return codes
Code |
Description |
0 |
The conversion was successful. |
<0 |
The conversion failed. |
Usage
Important: The function takes a machine-dependent long pointer (4 bytes on 32-bit and 8
bytes on 64-bit architectures), but the function converts to a 4-byte integer (overflow error
may occur if string does not represent a valid 2 byte integer).