c - fopen() 以路径为变量
问题描述
试图以相对路径打开文件,路径每次都不一样,我想用一个字符作为路径
目前我有:
char path[128];
strcat(path, "/home/pi/Analyses/");
strcat(path, lstAnalyse);
strcat(path, "/data.txt");
fopen(path, "a");
使用 char 作为 fopen 路径的正确方法是什么?
解决方案
推荐阅读
- pdf - 如何运行 imagemagick 仅将多个 PDF 文件的第一页批量转换为 JPEG?
- reactjs - 仅在第二次执行时反应更新状态
- powershell - 无法在 powershell 的 try/catch 语句中捕获异常
- go - 如何使用接口和反射定义安全划分?
- c# - UWP 滑块 滑动后
- bash - Escape characters in AWK script within bash script
- django - Difference between my droplet's postgres database and a newly created managed database
- mongodb - Mongodb Exporter 不显示使用 Docker 和 Prometheus 的指标
- python-3.x - AttributeError: X962
- c# - .NET Core 中的事务注释属性