int GetFmtErrNdx (void);
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.
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. */
None.
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. |