C 语言中 fflush(stdin) 的用法
函数 fflush(stdin) 用于刷新流的输出缓冲区。如果成功,则返回零,否则返回 EOF,并将 feof 错误指示器设置为 true。
以下是 C 语言中 fflush(stdin) 的语法:
int fflush(FILE *stream);
以下是 C 语言中 fflush(stdin) 的一个示例:
示例
#include
#include
int main() {
char s[20] = "Helloworld";
printf("The string : %s", s);
fflush(stdin);
return 0;
}输出
The string : Helloworld
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP