路径分割_splitpath_s

  1. #include <iostream>  
  2. #include <cstdlib>  
  3. using namespace std;  
  4.   
  5. int main()  
  6. {  
  7.     char *path="c:/renjingwei/ren/jing/wei/wo/张信哲--白月光.mp3";  
  8.     char drive[5];  
  9.     char dir[100];  
  10.     char filename[100];  
  11.     char fileext[10];  
  12.     _splitpath(path,drive,dir,filename,fileext);  
  13.     cout<<"filepath: "<<path<<endl  
  14.         <<"drive: "<<drive<<endl  
  15.         <<"dir: "<<dir<<endl  
  16.         <<"filename: "<<filename<<endl  
  17.         <<"fileext: "<<fileext<<endl;  
  18.     system("pause");  
  19.     return 0;  
  20. }  
  21. 路径分割_splitpath_s