哥哥姐姐们帮我看下这个代码对不对呀,为啥我明明新建了文档,但是结果却总是说没办法打开呢
谢谢

#include<stdio.h>
#include<stdlib.h>
void main()
{
FILE*fp;
char ch,filename[20];
printf("please input the filename you want to write:");
scanf("%s",filename);
if( !(fp==fopen(filename,"wt+")) );
{
printf("cannot open the file!\n");
exit(0);
}
printf("please input the sentences you want to write:");
ch=getchar();
ch=getchar();
while( ch!=EOF )
{
fputc(ch,fp);
ch=getchar();
}
fclose(fp);
}


#include<stdio.h>
#include<stdlib.h>
void main()
{
FILE*fp;
char ch,filename[20];
printf("please input the filename you want to write:");
scanf("%s",filename);
if( !(fp==fopen(filename,"wt+")) );
{
printf("cannot open the file!\n");
exit(0);
}
printf("please input the sentences you want to write:");
ch=getchar();
ch=getchar();
while( ch!=EOF )
{
fputc(ch,fp);
ch=getchar();
}
fclose(fp);
}
...全文
相关推荐
大班主题教案《我当哥哥姐姐》润新教育.txt
大班主题教案《我当哥哥姐姐》润新教育.txt
工作记录1——快速数据库设计文档编写、常调试sql、快速关闭端口号、吐槽
1、录入测试数据的哥哥姐姐们,也是个脑残,一个名字录入tmd50个空格,害我折腾半小时。2、tmd腾讯服务器,晚上是真tmd的卡啊,建了半天的表,明明保存上,又给我卡掉了!SELECT * FROM `表名` WHERE id = 9234。建议还是老老实实同步到本地,先在本地建表开发吧!SELECT count(1) FROM `表名`truncate table `表名`-- 查询表的数据数量。-- 清除某个表的数据。
2020只剩一个月 这群男人却靠着不努力过上了幸福生活
派盘双十二钜惠开启,12.12元体验全功能!https://www.huluer.com/product/ichainpi/ 派盘能做什么? 今天讲的是小鲜肉和大姐姐的故事,特别欢乐 在遥远的非洲大草原上,有一个可爱的小小国家,叫冈比亚,美丽非常。 这里有48公里的海岸线,海清沙细、椰林风光、草屋风情引人入胜。 四处都是质朴的原野风格。 还有壮阔的红树林带和随之形成的珍稀鸟类观鸟天堂。 吸引了许多欧洲的游客来这里度假旅游。 但这个美好的国家还有一个特质,穷。 和其他的非洲国家一样,很穷 这导致游
跳舞-小哥哥小姐姐-50首.zip
跳舞-小哥哥小姐姐-50首.zip
幼儿中班主题教案《做大班的哥哥姐姐》润新教育.txt
幼儿中班主题教案《做大班的哥哥姐姐》润新教育.txt


