VC++ 5.0 : strange stl error? 
Author Message
 VC++ 5.0 : strange stl error?

I'm having some problems with the "new" STL shipped with VC++ 5.0.
If I include <iostream> and <string> instead of <iostream.h>
and <string.h>, which I think is in the new C++ standard or at
least in the proposals, then I need to press return twice for a single
getline, which is clearly an error.

To get this error, create a console application, all settings default
and this code:

#include <iostream>

using namespace std;

int main() {
        char s[100];
        cin.getline( s, sizeof(s) );
        cout << "Got: " << s << endl;
        return 0;

Quote:
}

Run it
ENTER :   a<RETURN>    NOTHING HAPPENS
           <RETURN>    PRESS SECOND RETURN AND YOU GET THE OUTPUT
PRINTS:   Got: a

But the "old" STL works fine

#include <iostream.h>  // ### ADD .h

// #### REMOVE: using namespace std;

int main() {
        char s[100];
        cin.getline( s, sizeof(s) );
        cout << "Got: " << s << endl;
        return 0;

Quote:
}

Run it
ENTER :   a<RETURN>    DON'T NEED SECOND RETURN
PRINTS:   Got: a

Any suggestions or workaround?




Sun, 07 Nov 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. cin.getline bug (was VC++ 5.0 : strange stl error?)

2. Strange VC++ 5.0 / STL bug/feature?

3. STL Map Compiler Errors (VC++ 5.0)

4. STL & VC++ 5.0 error

5. STL: multimap.count function random error in VC++ 5.0

6. C++ 5.0 and STL - openmode compile error and CK4002 CVPACK accvio/error

7. stl and vc++ 5.0

8. strange stl linking error

9. Strange problem with VC++'s STL map

10. Link Errors with VC++ 5.0 that didn't happen with VC++ 4.2b

11. VC 6.0 -> VC 5.0 Error

12. Q: run-time error VC++ 4.0 source in VC++ 5.0

 

 
Powered by phpBB® Forum Software