c++ - How do I modify the internal buffer of std::cin -


I am writing a software that is std :: cin

P> But it's unlikely that I'm trying to avoid the possibility that the password be pageted from memory to disk, so that I can write the password as soon as 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

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -