Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
getchar_unlocked() in C
The function getchar_unlocked() is deprecated in Windows because it is a thread unsafe version of getchar(). It is suggested not to use getchar_unlocked(). There is no stream lock check that’s why getchar_unlocked is unsafe. The function getchar_unlocked() is faster than getchar().
Here is the syntax of getchar_unlocked() in C language,
int getchar_unlocked(void);
A program of getchar_unlocked() in C is as follows −
Example
#include <stdio.h>
int main() {
char val;
val = getchar_unlocked();
printf("Enter the character : \n");
printf("Entered character : %c", val);
return 0;
}
Output
Here is the output
Enter the character : a Entered character : a
Advertisements
