Sign in to follow this  
dbzprogrammer

The woes of cin...

Recommended Posts

Cin, what a useless piece of crap. Now that that's out of my system, cin isn't too bad. Just, because it's a stream, it screws up. Anyways, onto my problem. I'm using cin to enter data into strings. However, cin will stop inputing at a space character. How can I solve this? Well, I used getline(), which worked for a bit. But, then when I use it more than once, it starts chopping off characters in the front of a string... So, how do I solve it? I'd like strings to be strings. Not cutting, not ommiting. But, cin won't do that to my knowledge. Help would be appreciated.

Share this post


Link to post
Share on other sites
Yikes. Hm. Well, back when Microsoft released that software (you know, EIGHT YEARS AGO) there was a bug in the STL implementation that caused problems with getline. I only dimly remember it, since now you can download, FOR FREE, a new version of VC++ which is faster and has more features and is more standards compliant and less buggy and easier to use and doesn't, you know, suck balls.

If you insist on continuing to use a compiler that was developed before C++ was standardized, back when Britney Spears was "a bold new talent", you should look here.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Sneftel
Yikes. Hm. Well, back when Microsoft released that software (you know, EIGHT YEARS AGO) there was a bug in the STL implementation that caused problems with getline. I only dimly remember it, since now you can download, FOR FREE, a new version of VC++ which is faster and has more features and is more standards compliant and less buggy and easier to use and doesn't, you know, suck balls.

If you insist on continuing to use a compiler that was developed before C++ was standardized, back when Britney Spears was "a bold new talent", you should look here.


More like 9-10 years ago. VC6 was released in 1997, so coming up to 10 next year.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by dbzprogrammer
Yea, I don't have SP2, and last time I installed it, my HDD crashed and I lost a lot of documents. I don't need to do that again. Ty for the link. (Is there a way to switch out compiler in VC6?)


Yeah install SP2 but learn the art of this thing called BACKING UP then maybe you won't have that issue.

Share this post


Link to post
Share on other sites
Are you using cin.getline or std::getline?

I've used both methods in VC++ 98 for many years without problems, when utilized properly that is.

Sneftel does bring forth a good point re: Visual C++ .NET 2005 Express Edition is free.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sneftel
If you insist on continuing to use a compiler that was developed before C++ was standardized, back when Britney Spears was "a bold new talent", you should look here.

Actually, VC6 had been out a year or two before Ms Spears became a bold new talent.

CM

Share this post


Link to post
Share on other sites
Well if you can't install VC Express, use something like Code::Blocks. GCC might not have the best debugger but at least it has a proper implementation of the STL, and isn't a decade old peice of crap.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this