![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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