Testing for Extraction Errors
Output error processing functions, discussed in Error Processing Functions, apply to input streams. Testing for errors during extraction is important. Consider this statement:
cin>> n;
If n
is a signed integer, a value greater than 32,767 (the maximum allowed value, or MAX_INT) sets the stream's fail
bit, and the cin
object becomes unusable. All subsequent extractions result in an immediate return with no value stored.
See also
Tilbakemeldinger
https://aka.ms/ContentUserFeedback.
Kommer snart: Gjennom 2024 faser vi ut GitHub Issues som tilbakemeldingsmekanisme for innhold, og erstatter det med et nytt system for tilbakemeldinger. Hvis du vil ha mer informasjon, kan du se:Send inn og vis tilbakemelding for