We recommend using Visual Studio 2017

_putch_nolock, _putwch_nolock


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at _putch_nolock, _putwch_nolock.

Writes a character to the console without locking the thread.

System_CAPS_ICON_important.jpg Important

This API cannot be used in applications that execute in the Windows Runtime. For more information, see CRT functions not supported with /ZW.

      int _putch_nolock(  
int c  
wint_t _putwch_nolock(  
wchar_t c  


Character to be output.

Returns c if successful. If _putch_nolock fails, it returns EOF; if _putwch_nolock fails, it returns WEOF.

_putch_nolock and _putwch_nolock are identical to _putch and _putwch, respectively, except that they are not protected from interference by other threads. They might be faster because they do not incur the overhead of locking out other threads. Use these functions only in thread-safe contexts such as single-threaded applications or where the calling scope already handles thread isolation.

Generic-Text Routine Mappings

Tchar.h routine_UNICODE and _MBCS not defined_MBCS defined_UNICODE defined
RoutineRequired header

For more compatibility information, see Compatibility.

All versions of the C run-time libraries.

Console and Port I/O
_cprintf, _cprintf_l, _cwprintf, _cwprintf_l
_getch, _getwch