C

您所在的位置:网站首页 rewind什么意思c语言 C

C

2024-07-11 06:54| 来源: 网络整理| 查看: 265

rewind 在标头 中定义 void rewind( FILE *stream );

将文件位置指示器移动到给定文件流的开头。

该功能与 fseek(stream, 0, SEEK_SET); 等效,只是清除了文件结束和错误指示器。

该函数会删除之前调用 ungetc 的任何影响。

Parameters stream - 要修改的文件流 Return value

(none)

Example

这个例子展示了如何读取一个文件两次

#include char str[20]; int main(void) { FILE *f; char ch; f = fopen("file.txt", "w"); for (ch = '0'; ch C++ documentation 换 rewind

© cppreference.comLicensed under the Creative Commons Attribution-ShareAlike Unported License v3.0. https://en.cppreference.com/w/c/io/rewind



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3