|
楼主 |
发表于 2004-5-8 17:37:18
|
显示全部楼层
<>函数名: fnmerge
功 能: 建立新文件名
用 法: void fnerge(char *path, char *drive, char *dir);
程序例: <>#include <string.h>
#include <stdio.h>
#include <dir.h>
<>int main(void)
{
char s[MAXPATH];
char drive[MAXDRIVE];
char dir[MAXDIR];
char file[MAXFILE];
char ext[MAXEXT]; <P> getcwd(s,MAXPATH); /* get the current working directory */
strcat(s,"\\"); /* append on a trailing \ character */
fnsplit(s,drive,dir,file,ext); /* split the string to separate elems */
strcpy(file,"DATA");
strcpy(ext,".TXT");
fnmerge(s,drive,dir,file,ext); /* merge everything into one string */
puts(s); /* display resulting string */ <P> return 0;
}
</P> |
|