_splitpath,_makepath分析路径

生成路径,分解路径

FROM MSDN:

Example

/* MAKEPATH.C */

#include <stdlib.h>
#include <stdio.h>

void main( void )
{
   char path_buffer[_MAX_PATH];
   char drive[_MAX_DRIVE];
   char dir[_MAX_DIR];
   char fname[_MAX_FNAME];
   char ext[_MAX_EXT];

   ( path_buffer, "c", "//sample//crt//", "makepath", "c" );
   printf( "Path created with _makepath: %s/n/n", path_buffer );
   ( path_buffer, drive, dir, fname, ext );
   printf( "Path extracted with _splitpath:/n" );
   printf( "  Drive: %s/n", drive );
   printf( "  Dir: %s/n", dir );
   printf( "  Filename: %s/n", fname );
   printf( "  Ext: %s/n", ext );
}

Output

Path created with _makepath: c:/sample/crt/makepath.c

Path extracted with _splitpath:
  Drive: c:
  Dir: /sample/crt/
  Filename: makepath
  Ext: .c
发布了175 篇原创文章 · 获赞 19 · 访问量 61万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览