_putchar_nolock_putwchar_nolock

ロックせずに stdout に文字を書き込みます。

構文

int _putchar_nolock(
   int c
);
wint_t _putwchar_nolock(
   wchar_t c
);

パラメーター

c
書き込む文字。

戻り値

putchar、putwchar」をご覧ください。

解説

putchar_nolock_putwchar_nolock は、他のスレッドによる干渉から保護されていないことを除けば _nolock サフィックスが付いていないバージョンと同じです。 他のスレッドをロックアウトするオーバーヘッドが発生しないため、処理が速くなる場合があります。 これらの関数は、シングルスレッド アプリケーション、呼び出し元のスコープで既にスレッド分離を処理している場合などのスレッドセーフなコンテキストでのみ使用してください。

汎用テキスト ルーチンのマップ

Tchar.h のルーチン _UNICODE_MBCS が定義されていない _MBCS が定義されている _UNICODE が定義されている
_puttchar_nolock _putchar_nolock _putchar_nolock _putwchar_nolock

要件

ルーチンによって返される値 必須ヘッダー
_putchar_nolock <stdio.h>
_putwchar_nolock <stdio.h> または <wchar.h>

ユニバーサル Windows プラットフォーム (UWP) アプリではコンソールがサポートされていません。 コンソール (stdinstdoutstderr) に関連付けられている標準ストリームのハンドルは、C ランタイム関数によって UWP アプリで使用される前に、リダイレクトする必要があります。 互換性の詳細については、「 Compatibility」を参照してください。

ライブラリ

C ランタイム ライブラリのすべてのバージョン。

// crt_putchar_nolock.c
/* This program uses putchar to write buffer
* to stdout. If an error occurs, the program
* stops before writing the entire buffer.
*/

#include <stdio.h>

int main( void )
{
   FILE *stream;
   char *p, buffer[] = "This is the line of output\n";
   int  ch;

   ch = 0;

   for( p = buffer; (ch != EOF) && (*p != '\0'); p++ )
      ch = _putchar_nolock( *p );
}

出力

This is the line of output

関連項目

ストリーム入出力
fputcfputwc
fgetcfgetwc