gpt4 book ai didi

c - 获取由 mkstemp() 创建的文件名

转载 作者:太空狗 更新时间:2023-10-29 15:51:58 26 4
gpt4 key购买 nike

是否可以通过调用 mkstemp() 获取文件名(和路径)?如果"is",怎么做?

最佳答案

来自mkstemp manual page :

The last six characters of template must be "XXXXXX" and these are replaced with a string that makes the filename unique. Since it will be modified, template must not be a string constant, but should be declared as a character array.

所以你声明一个数组并将它传递给函数,函数将修改它,然后你在数组中有文件名。

关于c - 获取由 mkstemp() 创建的文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32463299/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com