This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/24206] New: cin.rdbuf->in_avail() always return 0
- From: "raj dot khem at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Oct 2005 23:31:55 -0000
- Subject: [Bug libstdc++/24206] New: cin.rdbuf->in_avail() always return 0
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code when run always returns 0 for in_avail()
To reproduce, just compile the following code with g++ with no commandline
switches and run the resulting binary.
#include <iostream>
using namespace std;
int main () {
streamsize size;
char ch;
streambuf * pbuf;
pbuf = cin.rdbuf();
cout << "Please enter some characters: ";
cin >> ch;
size = pbuf->in_avail();
cout << "The first character you entered is: " << ch << endl;
cout << size << " additional characters in input buffer" << endl;
return 0;
}
--
Summary: cin.rdbuf->in_avail() always return 0
Product: gcc
Version: 4.0.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: raj dot khem at gmail dot com
GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24206