LPTSTR PathFindNextComponent(LPCTSTR Path);
引数の意味は以下の通り。
Path | 次の構成要素を探すパス。 |
戻り値は、検索結果の構成要素へのポインタである。関数の実行に失敗した場合、NULLが返される。
void TestFindNextComponent(void) { char s[100] = "c:\\windows\\system32\\kernel32.dll"; char t[100]; char *cp; char *prev; prev = cp = s; while((cp = PathFindNextComponent(cp)) != NULL) { StrCpyN(t, prev, cp-prev); printf("%s\n", t); prev = cp; } }