code\\CL\\Desktop\\t
#include <stdio.h>
int main()
{
FILE* pf = fopen("test.txt", "w");//以写的方式打开文件
//. 表示当前路径
//.. 表示上一级路径
//FILE* pf = fopen("D:\\code\\CL\\Desktop\\test.txt", "w");//绝对路径
//FILE* pf = fopen(".\\..\\test.txt", "w");//相对路径(当前路径的上一级路径)
if (pf == NULL)
{
perror("fopen");
return 1;
}
else
{
printf("文件打开成功\n");
}
//写文件
//...
//关闭文件
fclo www.laipuhuo.com se(pf);
pf = NULL;
return 0;
}
int main()
{
FILE* pf = fopen("test.txt", "w");//以写的方式打开文件
//. 表示当前路径
//.. 表示上一级路径
//FILE* pf = fopen("D:\\code\\CL\\Desktop\\test.txt", "w");//绝对路径
//FILE* pf = fopen(".\\..\\test.txt", "w");//相对路径(当前路径的上一级路径)
if (pf == NULL)
{
perror("fopen");
return 1;
}
else
{
printf("文件打开成功\n");
}
//写文件
//...
//关闭文件
fclo www.laipuhuo.com se(pf);
pf = NULL;
return 0;
}
全部评论
相关推荐
点赞 评论 收藏
分享
11-03 18:30
湖南大学 游戏策划
嵌入式的小白:其实说句实话,这个福利背后是后一套逻辑的
1.公司食堂提供免费的早餐,但不会提供到比如10点,这样大家就会早点来公司
2.食堂提供宵夜,也是同样的道理,想让员工晚上加班
3.提供健身房,也是希望看能不能把大家吸引来周末加班
4.有宿舍的,这个宿舍一般不会很远的,缩短在路上的耗时,更多的时间就放在公司上了
巨人网络公司福利 91人发布 点赞 评论 收藏
分享