answersLogoWhite

0


Best Answer

In C++ we clear an input buffer as follows:

std::cin.clear(); // clear the error state (if any)

std::cin.ignore (numeric_limits<streamsize>::max()); // read and ignore everything until EOF

User Avatar

Wiki User

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are some different ways to clear the input buffer in C and Cpp?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you use a buffer in place of latch and vice versa in 8085 interfacing?

A buffer is a signal booster that allows you to drive lines with a larger fan-in requirement. A latch is a device that remembers the state of an input line after some point in time. The two are not interchangable.


What is meant by pinned buffer in comptuer organization?

due to some reasons, a buffer that should not be replaced is called pinned buffer


What are some examples of a buffer?

Some examples of a buffer are mixture of ammonium hydroxide with ammonium chloride &amp; mixture of acetic acid and sodium acetate.


Is the buffer supposed to keep the pH of a solution at 7?

Some buffer solutions maintain pH at 7, but others have different pH values. It is common to have buffers with pH values of 4, 7, and 10 for calibrating pH meters, for example.


Is a keyboard a output or input?

The keyboard is input deviceinput


What are some examples of an organic buffer?

blood,protein


Is a buffer a solution that maintains a neutral pH?

Yes, buffers nutralize acids in the medium.


What is sodium carbonate role in cell culture?

It is used to buffer the medium (there is some phosphate buffer in medium too). the carbonate/hydrocarbonat buffer in medium is in equilibrium with the CO2 in the incubator (usually set on 5%)


What is the use of buffer circuit?

One prominent application is this: Some circuits have an output impedance very high. If these circuits are coupled with another circuit of low input impedance, the desired functionality of the latter circuit will be drastically affected. Because the first circuit tries to deliver large voltage to the second and the second invariably requires small input voltage. To avoid the circuit disfunctionality, a buffer circuit (a circuit with high i/p impedance and a low o/p impedance) is used. Another application is in the delay matching. This is an advanced topic though. The technology is still new. In delay matching, the latter circuit requires a delay of say "n" seconds after the first circuit's output. A buffer circuit is used in such cases also. The circuit design is totally different than the impedance matching case.


When were inputoutput devices created?

Hi, Input/output devices have been around since the inception of electronics, in one form or another. There would be no reasoning to having a device input, without having an output of some type, or a function for it to complete. In computerese, it's a device that has the capability ot either input data or output data on demand. Hope this helps to clear up some of the mystery. Cubby


The normal pH of rainwater in some areas of Michigan is between 4 and 5. The lower peninsula has a natural buffer in the water and soil. what is this buffer?

chalk, calcium


What time will sunset be on September 10 2010?

In different parts of the world it will set at different times. Perhaps you can find some online calculator that will calculate it for your town, once you input the correct data. The input data includes latitude and longitude, your time zone, and of course the date.