且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从用户在C ++中输入的路径获取文件名

更新时间:2021-07-27 20:25:13

看看 ^ ].


从最后一个字节开始搜索对于路径分隔符(如果有),则从该位置复制到结尾.如果没有任何路径分隔符,则整个字符串为文件名
from the last byte start searching for the path separator if you got it then you copy from that position to end. if you dont get any path separator then entire string is the filename