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 好听的元旦简短祝福语