No, it doesn't work.
cin.clear() clears the flag. But program still doesn't work.
No, it doesn't work.
cin.clear() clears the flag. But program still doesn't work.
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C
What's your code? I doubt I can help you, but I at least want to try figuring it out.
My code is what i've posted plus a cin.clear() before cin.get(). I better go for your suggestion and use substr().
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C
I don't know what I am doing tonight. After forgotting basic things. Now I see I placed the code in an infinite loop. The last problem was because of this. Thank you so much for your help. I didn't know about ctrl+z. Now I am using a string, a stream and rdbuf().
The only thing I don't know is how to copy a stream into another.
Thanks again.
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C
What's wrong with the code in post #13?
I should be thanking you. I learned a lot by trying to find the answers to help.Originally Posted by siavoshkc
It puts cin into another stream indirectky. Is it possible to do it directly?What's wrong with the code in post #13?
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C
Yes, with rdbuf, but you have to deal with finding the end of the stream issue. If you're fine with ctrl-z, then that's how you would do it.
And this is exactly what I am doing.
Learn C++ (C++ Books, C Books, FAQ, Forum Search)
Code painter latest version on sourceforge DOWNLOAD NOW!
Download FSB Data Integrity Tester.
Siavosh K C