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

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

问题描述:

如何从c ++中的路径获取文件名.

how to get the filename from the path in c++

看看 ^ ].


从最后一个字节开始搜索对于路径分隔符(如果有),则从该位置复制到结尾.如果没有任何路径分隔符,则整个字符串为文件名
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