Input/Output

28 flashcardspar John
Réviser ces flashcardsGratuit · répétition espacée · iPhone, Android, Mac et web

Toutes les cartes

1
What to include for cin and cout
<iostream>
2
What does cin.clear() do?
Sets a new value for the stream's internal error state flags.
The current value of the flags is overwritten: All bits are replaced by those in state; If state is goodbit (which is zero) all error flags are cleared.
3
What does cin.ignore() do?
Extracts characters from the input sequence and discards them, until either n characters have been extracted, or one compares equal to delim.
4
What does wrapping cin in an if statement do?
In C++, stream classes implement operator bool() which allows them to be implicitly converted to a boolean. This boolean indicates whether the streams are in a good or bad state.
5
%d
decimal
6
%x or %X
Hex and Hex uppercase
7
%f
float
8
%e
scientific notation
9
%E
Scientific notation uppercase
10
%c
character
11
%s
string of characters
12
%p
pointer adress
13
%n
stores the number of characters at a pointer in a signed int
14
flag -
left justify
15
flag +
shows sign of numbers
16
flag #
Shows 0x or 0X before hex values and forces decimal point on numbers
17
flag 0
Left pads with zeros instead of spaces
18
printf usage
%[flags][width][.precision]specifier
19
width *
width is stored in variable section
20
I/O manipulators included in <iostream>
endl, fixed, showpoint
21
I/O Manipulators in <iomanip>
setw(), setprecision(), scientific, hex, dec, setfill(' '), left, right
22
The only io manipulaitor that is not persistent
setw()
23
How to check if cin failed
if (!cin)
24
How to put cin back to normal after error
cin.clear() - clears error messages
25
How to remove bad input from cin and what do you include
cin.ignore(numeric_limits<streamsize>::max(), '\n'), #include <limits>
26
Condition for s while loop that exits on good input
!cin.good()
27
how to use scanf?
scanf("%[flags][width][.precision]specifier", specifier_data_type)
28
what to include for scanf and printf?
#include <cstdio.h>
Réviser les 28 cartes gratuitement

Plus de flashcards

Czech-German Vocabulary: Verbs113 cartesLangues · Tchèque → NéerlandaisKrecekLoveOpérateurs vectoriels : Gradient et Différentielle81 cartesMathématiques · FrançaismaneckNiemiecki: Sporty62 cartesLangues · Polonais → AllemandzuziolekUwUKidney and Interstitium: Renal Physiology Q&A663 cartesMédecine et santé · Anglaisun étudiant OutLearn5 cosa conta nella vita 2/440 cartesLangues · Italien → Allemand:3Mutlimedia in Information Systems32 cartesInformatique · Anglais—Griffith—Biomechanics26 cartesAnglaisAristotelisStats Final exam22 cartesMathématiques · AnglaisRafaelOrganic Chemistry top facts17 cartesSciences · AnglaisAli_vxxxTerms14 cartesAnglaisAshleyGER 1004 Quiz 410 cartesLangues · Anglais → AllemandngjSvenska 1.5 - Dokter191 cartesLangues · Néerlandais → SuédoisSeppe

Révise ces decks dans l’app

Gratuit sur iPhone, Android, Mac et le web. Ajoute n’importe quel deck à ton compte en un tap.

Télécharger dans l’App StoreDisponible sur Google Play
Réviser les 28 cartes gratuitement