Flashcards in Week 5 (Interactivity) Deck (21):
what is the preferred way to input a string?
what is the syntax for the get line function
how to get a char input and store it?
cin.get(ch); ch = cin.get
how to ignore characters in the buffer?
(n= numbers of characters to skip)
(c = character)
skips n characters or until c is encountered
how to get the length of a string?
integerIdentifier = stringIdentifier.length( )
How to concatenate strings?
What are c-strings?
Arrays of chars that act as strings.
how do you copy strings with string objects?
how can you limit the amount of characters stored into a c-string
cin >> setw(n) >> word;
How do you read in a whole line with c string?
What to include math library functions
what to include for random numbers
what function to call to return a integer random number.
what does a seed value do?
Helps generate random numbers
How to set a seed value?
how to make the seed value more random
seed = time(0);
Five steps for file input:
Include header file
define file stream object
Use File (read/ write)
what is the header file for file input?
what are the types of objects for file input / output
ofstream - output file
ifstream - input file
fstream - file stream, input and output
how do you open a file for input/output?