void main() { char path[100]; _makepath(path, "C", "\\", "setup", ".txt"); printf("path = %s\n", path); }
프로그램 실행화면
void _makepath(char *path, const char *drive, const char *dir, const char *fname, const char *ext);
디렉토리 관리 함수 중에서 _splitpath()이 함수와 한 쌍으로 쓰이는 함수이다. 하는 역할은 _splitpath()에 사용할 경로path를 만들어 준다. drive, dir, fname, ext를 합쳐준다.
이 함수로 path를 만들어 주고 _splitpath()에서 바로 사용하면 된다. 각 인자의 역할은 위의 예제 프로그램을 보면 쉽게 알 수 있을 것이다.