gpt4 book ai didi

c - 如何获取特定路径中已知文件的文件指针( FILE* )?

转载 作者:行者123 更新时间:2023-11-30 21:16:35 24 4
gpt4 key购买 nike

要读/写文件,我需要 Unix 环境中 C 语言的文件指针。我知道文件名和路径,但如何使用其名称和路径获取文件指针。

最佳答案

#include <stdio.h>
FILE * pFile;
pFile = fopen ("myfile.txt","w");

关于c - 如何获取特定路径中已知文件的文件指针( FILE* )?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18439972/

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