getchar_unlocked() फ़ंक्शन Windows में डिप्रिकेटेड है क्योंकि यह getchar() का थ्रेड-अनसेफ वर्जन है। getchar_unlocked() का उपयोग न करने का सुझाव दिया जाता है। कोई स्ट्रीम लॉक चेक नहीं है इसलिए getchar_unlocked असुरक्षित है। getchar_unlocked() फ़ंक्शन getchar() से तेज़ है।
C में सिंटैक्स
int getchar_unlocked(void);
उदाहरण
#include <stdio.h>
int main() {
char val;
val = getchar_unlocked();
printf("कैरेक्टर दर्ज करें: \n");
printf("दर्ज किया गया कैरेक्टर: %c", val);
return 0;
}
आउटपुट
कैरेक्टर दर्ज करें: a दर्ज किया गया कैरेक्टर: a