Input/Output

28 Karteikartenvon John
Diese Karteikarten lernenKostenlos · Spaced Repetition · iPhone, Android, Mac & Web

Alle Karten

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>
Alle 28 Karten kostenlos lernen

Mehr Karteikarten

Czech-German Vocabulary: Verbs113 KartenSprachen · Tschechisch → NiederländischKrecekLoveOpérateurs vectoriels : Gradient et Différentielle81 KartenMathe · FranzösischmaneckNiemiecki: Sporty62 KartenSprachen · Polnisch → DeutschzuziolekUwUKidney and Interstitium: Renal Physiology Q&A663 KartenMedizin und Gesundheit · Englischeinem OutLearn-Studierenden5 cosa conta nella vita 2/440 KartenSprachen · Italienisch → Deutsch:3Mutlimedia in Information Systems32 KartenInformatik · Englisch—Griffith—Biomechanics26 KartenEnglischAristotelisStats Final exam22 KartenMathe · EnglischRafaelOrganic Chemistry top facts17 KartenNaturwissenschaften · EnglischAli_vxxxTerms14 KartenEnglischAshleyGER 1004 Quiz 410 KartenSprachen · Englisch → DeutschngjSvenska 1.5 - Dokter191 KartenSprachen · Niederländisch → SchwedischSeppe

Lerne diese Decks in der App

Kostenlos auf iPhone, Android, Mac und im Web. Füge jedes Deck mit einem Tipp zu deinem Konto hinzu.

Laden im App StoreJetzt bei Google Play
Alle 28 Karten kostenlos lernen