c - 如何在不使用倒带功能的情况下清除输入缓冲区?
问题描述
我曾经在 Visual Studio 2019 中使用 rewind() 函数清除输入缓冲区,但在 GCC 编译器中无法使用 rewind() 函数。(简单示例>>)
scanf("%s",temp);
rewind(stdin) /* Are there any ways to clear the input buffer?*/
我应该使用哪个函数来清除 GCC 编译器中的输入缓冲区?
有什么好的方法可以在不使用某些功能的情况下清除输入缓冲区?
解决方案
推荐阅读
- javascript - 解析文件并创建符合特定条件的键值对
- java - 从命令行启动时,Spring Batch 不产生日志输出
- android - 为什么Android Studio arm64系统镜像很慢?
- node.js - 如何修复节点中注释长度无效的无效 zip 文件(供 yauzl 等严格库使用)
- php - Laravel 5.6 auth 指令不适用于某些视图
- r - 如何检查列表是否包含`NA`?
- ajax - 在枚举值中使用特殊字符
- java - 启动时在 Centos/Red Hat 中设置 Java 环境
- go - 变异参数作为对象
- postgresql - Sequelize - 使用嵌套实体的条件搜索查询