We recommend using Visual Studio 2017

_putch, _putwch


The latest version of this topic can be found at _putch, _putwch.

Writes a character to the console.

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(  
int c   
wint_t _putwch(  
   wchar_t c  


Character to be output.

Returns c if successful. If _putch fails, it returns EOF; if _putwch fails, it returns WEOF.

These functions write the character c directly, without buffering, to the console. In Windows NT, _putwch writes Unicode characters using the current console locale setting.

The versions with the _nolock suffix are identical except that they are not protected from interference by other threads. For more information, see _putch_nolock, _putwch_nolock.

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.

See the example for _getch.

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