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

标签 c file stdin stdio

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

#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/

相关文章:

python - ftp 发送 python bytesio 流

c++ - 应该在我的自定义>>运算符中调用istream::clear()吗?

c# - UWP 中的 Process.Start

c# - 从 stdin 非阻塞读取一个字节

c - 我怎样才能有一个新线程 "take over"stdin?

C 链表条件语句

c - 从C中指针指向的列表中删除数据

c++ - Valgrind - 无效的读写

c - 为随机全局变量播种 rand()

java - 使用 Zk 框架下载 zip