C 中的 getchar_unlocked()
由于是 getchar() 的线程不安全版本,因此 getchar_unlocked() 函数在 Windows 中已弃用。建议不要使用 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
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 语言编程
C++
C#
MongoDB
MySQL
Javascript
PHP