showFilesName.cpp

来源:互联网 发布:软件研发部门架构 编辑:程序博客网 时间:2024/06/02 07:30

// showFilesName.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <string.h>

char * returnFileNoPath(char * path)
{
    char* p=path;
 int len=strlen(path);
 p+=(len-1);

 while (*p != '\\')
 {
  p-=1;

 }

 p+=1;
    return p;

}
int main(int argc, char* argv[])
{
 for (int i=1;i<argc;i++)
 {
  printf("%s\n",returnFileNoPath(argv[i]));
 }
 getchar();
 return 0;
}


0 0