c++ how to remove filename from path string

前端 未结 5 1441
后悔当初
后悔当初 2020-12-09 02:53

I have

const char *pathname = \"..\\somepath\\somemorepath\\somefile.ext\";

how to transform that into

\"..\\somepath\\som         


        
5条回答
  •  隐瞒了意图╮
    2020-12-09 03:34

    PathRemoveFileSpec(...) you dont need windows 8 for this. you will need to include Shlwapi.h and Shlwapi.lib but they are winapi so you dont need any special SDK

提交回复
热议问题