LPSTR AnsiNext(lpchCurrentChar) | |||||
LPCSTR lpchCurrentChar; | /* address of current character | */ |
The AnsiNext function moves to the next character in a string.
lpchCurrentChar
Points to a character in a null-terminated string.
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.
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).
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);
}