_fgetc_nolock, _fgetwc_nolock
Bir karakter, bir iş parçacığı kilitlemeden okur.
int _fgetc_nolock(
FILE *stream
);
wint_t _fgetwc_nolock(
FILE *stream
);
Parametreler
- stream
İşaretçi FILE yapısı.
Dönüş Değeri
Seefgetc, fgetwc.
Notlar
_fgetc_nolockve _fgetwc_nolock aynıdır fgetc ve fgetwc, sırasıyla diğer iş parçacıkları tarafından girişime korunmaz olmasıdır.Kilitleme dışında başka iş yükü tabi değildir çünkü daha hızlı olabilir.Bu işlevler yalnızca iş parçacığı güvenli içerikleri tek iş parçacıklı uygulamalar ya da burada arama kapsamı iş parçacığı ayırma zaten işler gibi kullanın.
Genel metin yordamı eşlemeleri
Tchar.h yordamına girildi |
_UNICODE ve _mbcs tanımlı değil |
Tanımlanan _mbcs |
Tanımlanan _UNICODE |
---|---|---|---|
_fgettc_nolock |
_fgetc_nolock |
_fgetc_nolock |
_fgetwc_nolock |
Gereksinimler
İşlev |
Gerekli başlık |
---|---|
_fgetc_nolock |
<stdio.h> |
_fgetwc_nolock |
<stdio.h> veya <wchar.h> |
Daha fazla uyumluluk bilgileri için bkz: Uyumluluk giriş.
Örnek
// crt_fgetc_nolock.c
// This program uses getc to read the first
// 80 input characters (or until the end of input)
// and place them into a string named buffer.
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
FILE *stream;
char buffer[81];
int i, ch;
// Open file to read line from:
if( fopen_s( &stream, "crt_fgetc_nolock.txt", "r" ) != 0 )
exit( 0 );
// Read in first 80 characters and place them in "buffer":
ch = fgetc( stream );
for( i=0; (i < 80 ) && ( feof( stream ) == 0 ); i++ )
{
buffer[i] = (char)ch;
ch = _fgetc_nolock( stream );
}
// Add null to end string
buffer[i] = '\0';
printf( "%s\n", buffer );
fclose( stream );
}
Giriş: crt_fgetc_nolock.txt
Line one.
Line two.
Çıktı
Line one.
Line two.