Bagikan melalui


_putchar_nolock, _putwchar_nolock

Menulis karakter tanpa stdout mengunci.

Sintaks

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

Parameter

c
Karakter yang akan ditulis.

Nilai hasil

Lihat putchar, putwchar.

Keterangan

putchar_nolock dan _putwchar_nolock identik dengan versi tanpa _nolock akhiran kecuali bahwa versi tersebut tidak dilindungi dari gangguan oleh utas lain. Mereka mungkin lebih cepat karena mereka tidak menimbulkan overhead penguncian utas lain. Gunakan fungsi-fungsi ini hanya dalam konteks aman utas seperti aplikasi utas tunggal atau di mana cakupan panggilan sudah menangani isolasi utas.

Pemetaan rutin teks generik

Rutinitas Tchar.h _UNICODE dan _MBCS tidak ditentukan _MBCS Didefinisikan _UNICODE Didefinisikan
_puttchar_nolock _putchar_nolock _putchar_nolock _putwchar_nolock

Persyaratan

Rutin Header yang diperlukan
_putchar_nolock <stdio.h>
_putwchar_nolock <stdio.h> atau <wchar.h>

Konsol tidak didukung di aplikasi Platform Windows Universal (UWP). Handel aliran standar yang terkait dengan konsol, , stdin, stdoutdan stderr, harus dialihkan sebelum fungsi run-time C dapat menggunakannya di aplikasi UWP. Untuk informasi kompatibilitas selengkapnya, lihat Kompatibilitas.

Pustaka

Semua versi pustaka run-time C.

Contoh

// 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 );
}

Output

This is the line of output

Lihat juga

Streaming I/O
fputc, fputwc
fgetc, fgetwc