AnsiNext

2.x

  LPSTR AnsiNext(lpchCurrentChar)    
  LPCSTR lpchCurrentChar; /* address of current character */

The AnsiNext function moves to the next character in a string.

Parameters

lpchCurrentChar

Points to a character in a null-terminated string.

Return Value

The return value points to the next character in the string or to the null character at the end of the string, if the function is successful.

Comments

The AnsiNext function can be used to move through strings where each character is a single byte, or through strings where each character is two or more bytes (such as strings that contain characters from a Japanese character set).

Example

The following example uses the AnsiNext function to step through the characters in a filename:

/* Find the last backslash. */

for (lpszFile = lpszTemp; *lpszTemp != '\0';
        lpszTemp = AnsiNext(lpszTemp)) {

    if (*lpszTemp == '\\')
        lpszFile = AnsiNext(lpszTemp);
}

See Also

AnsiPrev