c - C程序没有输出
问题描述
我在运行我的 C 字符计数程序时遇到了一些问题。
我想知道为什么无论输入是什么都没有输出。这是我的程序:
#include <stdio.h>
int main(void)
{
int nc = 0;
while (getchar() != EOF)
{
++nc;
}
printf("%d\n", nc);
return 0;
}
解决方案
推荐阅读
- jfrog-container-registry - 如何设置远程存储库,即 cloud-JCR
- c# - 模拟 IConfiguration 的 GetChildren() 以返回列表
? - java - 将文件保存在同一程序中后出现 FileNotFound 异常
- javascript - 有没有办法增加(增加 1)并迭代变量标识符的特定字母?
- python - 如何在 Tkinter 中创建一个类似于 IDLE 的小型 Python Shell?
- c# - 如何停止和恢复受保护的触发 Windows 服务 AppIDSvc (AppLocker)
- mysql - PDO 中的执行语句在 MySQL 中插入空白数据
- php - 有没有办法在 composer.json 中指定二进制文件必须可用?
- windows - 获取驱动器列表后删除最后一个空条目 - 批处理脚本
- c++ - qsort 不适用于我的 impl 中的浮点类型。怎么了?