# GetFmtErrNdx

int GetFmtErrNdx (void);

## Purpose

If the format string of the preceding call contains an error, such as an invalid format or an inappropriate modifier, the return value of GetFmtErrNdx indicates the position within the format string, beginning with position zero, where the error was found. This information is useful in debugging faulty format strings. GetFmtErrNdx can report only one error per call, even if several errors exist within the string.

### Example

int i, n;
Scan ("1234", "%s>%d", &i);
n = GetFmtErrNdx ();
/* n will have the value -1, indicating that */
/* no error exists in the format string. */

## Parameters

None.

## Return Value

Name | Type | Description
n | integer | Zero–based index into the format string that indicates where GetFmtErrNdx found the non–recognizable format specifier. GetFmtErrNdx returns –1 when no error has occurred.