如何从用户在C ++中输入的路径获取文件名 [英] How to get filename from the path entered by the user in 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
这篇关于如何从用户在C ++中输入的路径获取文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文