c++ - How do I modify the internal buffer of std::cin -
I am writing a software that is std :: cin
std :: cin
I want to modify the buffer, with it M is done. Now I have this:
std :: cin.clear (); Std :: stringstream ss; SS & lt; & Lt; "00000000000000000000000000000000000000000000"; Std :: cin.rdbuf (ss.rdbuf ()); Std :: cin.clear ();
But I'm pretty sure this is bad because it does not take into account the current size of the can buffer.
P> To get the beginning and end of buffer you < You can use the code> gptr () and egptr ()
.
EDIT: As Charles Bailey told, it is preserved that my assumption is that if you want a stream buffer that you can clear your content on specified content, You want to apply that comes from one of the standard stream buffer classes, but a clear ()
member (or whatever name you find convenient). Changing the contents of the buffer without the buffer manager is usually a bad thing to know about it ...
Comments
Post a Comment