// project_01.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
char *path = "c:\\11\\22\\44\\111.jpg";
char *ptr;
while(1)
{
ptr = strstr(path, "\\");
if(NULL == ptr)
break;
ptr++;
path = ptr;
}
ptr = strstr(path, ".");
int t = ptr - path;
char pp[256] = {0};
strncpy(pp, path, t);
cout<<pp<<" "<<endl;;
return 0;
}
获取某个绝对路径下的文件名字
最新推荐文章于 2023-02-25 12:02:13 发布