C fgetc
#include <string.h>
#include <stdio.h>
#include <conio.h>
int
main(
void
)
{
FILE
*stream;
char
string[ ] =
"This is a test"
;
int
ch;
/* open a file for update */
stream =
fopen
(
"DUMMY.FIL"
,
"w+"
);
/* write a string into the file */
fwrite
(string,
strlen
(string), 1, stream);
/* seek to the beginning of the file */
fseek
(stream, 0, SEEK_SET);
do
{
/* read a char from the file */
ch =
fgetc
(stream);
/* display the character */
putch(ch);
}
while
(ch != EOF);
fclose
(stream);
return
0;
}
C fgetc的更多相关文章
- Linux C 文件输入输出函数 fopen()、getc()/fgetc()、putc()/fputc()、fclose()、fprintf()、fscanf()、fgets()、fputs()、fseek()、ftell()、fgetpos()、fsetpos() 详解
fopen(打开文件) 定义函数 FILE * fopen(const char * path,const char * mode); 函数说明 参数path字符串包含欲打开的文件路径及文件名,参 ...
- fgetc和fputc函数
1.输入函数 以下三个函数可用于一次读一个字符. #include <stdio.h> int getc( FILE *fp ); int fgetc( FILE *fp ); int g ...
- (转载)C++文件读写函数之——fopen、fread和fwrite、fgetc和fputc、fgets和fputs、ftellf和fseek、rewind
http://blog.sina.com.cn/s/blog_61437b3b0102v0bt.html http://blog.csdn.net/chenwk891/article/details/ ...
- 5.4.1 termios结构,关闭回显功能,一键入字符fgetc立刻返回,不用按下回车键
Linux提供了一组编程接口,用来控制终端驱动程序的行为.这样我们可以更精细的来控制终端. 例如: 回显:允许控制字符的回显,例如读取密码时. 使用termios结构的密码程序 #include &l ...
- C++之函数fgetc和fputc、fgets和fputs、fread和fwrite、fscanf和fprintf用法小结
#include <iostream> #include <cstdio> #include <cstdlib> using namespace std; int ...
- PHP 文件读取 fread、fgets、fgetc、file_get_contents 与 file 函数
fread().fgets().fgetc().file_get_contents() 与 file() 函数用于从文件中读取内容. fread() fread() 函数用于读取文件(可安全用于二进制 ...
- C语言中fgetc、fputc和getc、putc的区别是什么
看书的时候,发现了这四个函数,想知道他们的不同.结果上网查发现很多人说fgetc.fputc的f代表的是file,就是这两个函数是和文件有关的!但是一看他们的函数声明,如下图: 发现他们的参数里面都有 ...
- 字符的读写函数:fgetc()和fputc()
fgetc(); 功能: 从文件中读取字符. 头文件: #include <stdio.h> 函数原型:int fgetc(FILE *stream); 返 ...
- 三、fgetc与fputc
fgetc 功能:从流中读取一个字符 原型:int fgetc(FILE *stream); 参数: stream:要读取的流指针 返回:读取到的字符,如果读完则返回EOF,EOF是end of fi ...
随机推荐
- 【安卓】安卓res文件夹下的资源文件与R.java文件里面类的对应关系
对于drawable.layout.menu文件夹下的每一个文件都分别会在R.java文件里面生成drawable.layout.menu类的一个常量,类名就是文件夹的名字,常量的名字就是文件名字. ...
- C#高级编程笔记 2016年10月8日运算符和类型强制转换
1.checked和unchecked 运算符 C#提供了checked 和uncheckde 运算符.如果把一个代码块标记为checked, CLR就会执行溢出检查,如果发生溢出,就抛出overfl ...
- FileZillaFTP使用教程
FileZillaServer.exe服务启动和关闭程序 FileZilla Server Interface.exe 服务 管理程序 配置ftp服务器的用户名,密码,目录,目录读写权限 启动File ...
- jstl 小总结 以及 jstl fn
1.1.1 JSTL的使用 JSTL是JSP标准标签库.结合EL替换传统页面的<%%> * JSTL如果不会用.也是可以使用<%%>.但是一般在大公司使用JSTL.进入小公司. ...
- (2016弱校联盟十一专场10.3) A.Best Matched Pair
题目链接 #include<cstdio> #include<cstring> #include<algorithm> #include<stack> ...
- 【转】Caffe初试(五)视觉层及参数
本文只讲解视觉层(Vision Layers)的参数,视觉层包括Convolution, Pooling, Local Response Normalization (LRN), im2col等层. ...
- SpringBoot实战配置
http://blog.csdn.net/sun_t89/article/details/51944252 http://www.cnblogs.com/kreo/p/4423362.html
- JS将指定的时间戳转为UTC时间
Js中获取时间戳可用var dayMiliseconds = parseInt(new Date().valueOf());Js的时间戳单位为毫秒(1s = 1000 ms),下面是一个将制定的格式转 ...
- UltraEdit 注册机使用说明
请断开网络连接(或直接拔掉网线)后执行: 安装完成后,点击弹出界面的“注册”按钮,然后直接点击“激活”,此时UltraEdit检测到网络断开则弹出界面提示“脱机激活”,此时启动注册机,并将UltraE ...
- error LNK2019 无法解析的外部符号 __imp__accept@12
用VS2015编译CuraEngine,出现如下错误: PlatformSocket.obj error LNK2019 无法解析的外部符号 __imp__accept@12 PlatformSo ...