我正在尝试从绝对路径名中提取相对路径名。 C中有这个功能吗?是否有一个函数可以打印从特定字符开始的字符串(我有索引)?
最佳答案
在 POSIX.1-2001(例如 Linux)中,man 3 basename
给出:
block 引用>The functions dirname() and basename() break a null-terminated pathname string into directory and filename components. In the usual case, ... basename() returns the component following the final '/'. Trailing '/' characters are not counted as part of the pathname.
关于C 从特定字符打印字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12812330/