rstoi()

Converts a string to a 2-byte integer.

Syntax

mint rstoi(char *str, mint *val);
  1. str is a pointer to a null-terminated string.
  2. val is a pointer to a mint 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 int pointer (usually 4 bytes), but the function converts to a 2-byte integer (overflow error may occur if string does not represent a valid 2-byte integer).