当前位置:网站首页>Fgetc() reads content from file
Fgetc() reads content from file
2022-06-26 16:41:00 【Muzi..】
#include<stdio.h>
#include<stdlib.h>
int main( )
{
FILE *fp;
char ch,filename[20];
printf("please input the filename you want to write:");
scanf("%s",filename);
if(!(fp=fopen(filename,"r")))
{
printf("cannot open the file!\n");
exit(0);
}
while(ch!=EOF)
{
ch=fgetc(fp);
putchar(ch);
}
fclose(fp);
}
边栏推荐
猜你喜欢
[机缘参悟-31]:鬼谷子-抵巇[xī]篇-危机是危险与机会并存
Cuckoo filter for Chang'an chain transaction
TCP congestion control details | 1 summary
[graduation season] a word for graduates: the sky is high enough for birds to fly, and the sea is wide enough for fish to leap
Memory partition model
What does the inner structure of the neural network "alchemy furnace" look like? An interpretation of the thesis by the doctor of Oxford University
知道这几个命令让你掌握Shell自带工具
Arduino UNO + DS1302简单获取时间并串口打印
基于Kubebuilder开发Operator(入门使用)
R329 (maix-ii-a (M2A) data summary
随机推荐
When a programmer is disturbed 10 times a day, the consequences are amazing!
JS教程之使用 ElectronJS 桌面应用程序打印贴纸/标签
最小二乘系统辨识课 中篇:递归最小二乘
The details of the first pig heart transplantation were fully disclosed: human herpes virus was found in the patient, the weight of the heart doubled after death, and myocardial cell fibrosis
Keepalived 实现 Redis AutoFailover (RedisHA)1
How to implement interface current limiting?
Redis的ACID
Cloud platform monitoring system based on stm32+ Huawei cloud IOT design
Natural language inference with attention and fine tuning Bert pytorch
What is flush software? Is it safe to open an account online?
建立自己的网站(16)
JS tutorial electron JS is a good tool for designing powerful multi platform desktop applications
国内首款开源 MySQL HTAP 数据库即将发布,三大看点提前告知
MS|谢黎炜组发现混合益生菌制剂及其代谢产物可缓解结肠炎
QT 5.9.8 installation tutorial
Gui+sqlserver examination system
[从零开始学习FPGA编程-46]:视野篇 - 集成电路的发展与技术进步
What does the inner structure of the neural network "alchemy furnace" look like? An interpretation of the thesis by the doctor of Oxford University
Supplement the short board - Open Source im project openim about initialization / login / friend interface document introduction
TCP congestion control details | 1 summary