Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Returns the number of elements that are ready to be read from the buffer.
streamsize in_avail( );
Return Value
The number of elements that are ready to be read from the buffer.
Remarks
If a read position is available, the member function returns egptr – gptr. Otherwise, it returns showmanyc.
Example
// basic_streambuf_in_avail.cpp
// compile with: /EHsc
#include <iostream>
int main( )
{
using namespace std;
char c;
// cin's buffer is empty, in_avail will return 0
cout << cin.rdbuf( )->in_avail( ) << endl;
cin >> c;
cout << cin.rdbuf( )->in_avail( ) << endl;
}
Input
4
Sample Output
0
4
1
Requirements
Header: <streambuf>
Namespace: std