Results 1 to 5 of 5

Thread: Strange Compiler Anomaly: VC++/MinGW <resolved>

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Comreak's Avatar
    Join Date
    Feb 2001
    Location
    Dis
    Posts
    319

    Strange Compiler Anomaly: VC++/MinGW <resolved>

    --EDIT--
    The problem turned out to be some "bad implemenation" for in_avail() in GCC.

    Here's the code in question:

    Code:
    string input;
    
    cin >> input; //lets say the input is "hello hello"
    cout << "Your Text: " << input << endl;
    cout << "Number of chars: " << cin.rdbuf()->in_avail() << endl;
    When I compile this with Mingw, in_avail() returns 0. However, when I compile it with VC++7, it returns a proper count of the number of characters left in the buffer (in this case, 7). Any idea why this happens?
    Last edited by Comreak; Jun 4th, 2004 at 02:02 PM.
    C.O.M.R.E.A.K.: Cybernetic Obedient Machine Responsible for Exploration and Accurate Killing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width