gpt4 book ai didi

c - 这样创建的文件放在哪里?

转载 作者:太空宇宙 更新时间:2023-11-04 04:03:57 25 4
gpt4 key购买 nike

如何查看文件的创建位置并打开它?

#include <stdio.h>

int main ()
{
FILE * pFile;
char sentence [256];

printf ("Enter sentence to append: ");
fgets (sentence,255,stdin);
pFile = fopen ("mylog.txt","w");
fputs (sentence,pFile);
fclose (pFile);
return 0;
}

最佳答案

该文件将在您当前的工作目录中创建。

关于c - 这样创建的文件放在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8377725/

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