C语言中的getchar_unlocked()
Windows中不赞成使用getchar_unlocked()函数,因为它是的线程不安全版本getchar()。建议不要使用getchar_unlocked()。没有流锁定检查,这就是为什么getchar_unlocked不安全的原因。函数getchar_unlocked()比更快getchar()。
这是C语言中的getchar_unlocked()的语法,
int getchar_unlocked(void);
用C语言编写的getchar_unlocked()程序如下-
示例
#include <stdio.h>
int main() {
char val;
val = getchar_unlocked();
printf("Enter the character : \n");
printf("Entered character : %c", val);
return 0;
}输出结果
这是输出
Enter the character : a Entered character : a
热门推荐
10 生日祝福语哥哥英文简短
11 订婚祝福语活泼精辟简短
12 姐妹毕业贺卡祝福语简短
13 生日摆摊祝福语简短独特
14 成语祝福语精选大全简短
15 酒店晚餐生日祝福语简短
16 加油冬奥祝福语英文简短
17 高校女生祝福语大全简短
18 老人送别蛋糕祝福语简短