Sebastian丶
2017-10-25 05:53为什么fopen打开失败呢?
bool Creat_Text(const char* str, const char* filename)
{
char path[1024] = {0};
GetCurrentDirectory(1024, (LPWSTR)path);
strcat(path,"//");
strcat(path,filename);
FILE* fp = fopen(path,"a+");
if (NULL == fp)
{
return false;
}
fputs(str,fp);
fclose(fp);
return true;
}_
- 点赞
- 回答
- 收藏
- 复制链接分享
2条回答
为你推荐
- C语言,为什么文件内容读完了,后面出现很多乱码?
- c语言
- 2个回答
- fopen()无法打开流:权限被拒绝
- apache
- linux
- php
- 2个回答
- fopen()权限被拒绝
- permissions
- php
- fopen
- 1个回答
- c语言的fopen打不开文件?
- c语言
- 4个回答
- 从txt文件中读取数据存入到链表,即使文件没有内容也会存上数字和乱码
- c语言
- 开发语言
- 1个回答
换一换