Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
13 Cards in this Set
- Front
- Back
#include
|
*This line is what we call an include directive *similar to Java’s import statement |
|
# |
*any line starting with # isn’t a C++ statement *they’re preprocessor directives *ran before the program goes to the C++ compiler *#include works by effectively copy-pasting the entire contents of theincluded file in to our C++ file at the location of the directive |
|
int main() |
*indicates where our main function starts *main function is the first function executed when we run ourprogram *main should return an int type, 0 *0 indicates normal termination |
|
std:: |
*std namespace *like a package(java) and the :: operator says to get the cout object from the std namespace *endl is in the namespace as well, and rep. end line and flushed i/o buffer to print out asap |
|
sizeof( ); |
returns size of data type in bytes |
|
<iostream> |
*for doing input/output *goes with #include |
|
string literals |
char array that ends with a null terminating character: \0 |
|
cin>> |
*overloads the >> operator for placing input in to existing variables |
|
static_cast<DataType>(Value) |
*general format for basic type cast *this casts Value to the type DataType |
|
formatted output using cout |
*If we want to format our output, e.g., to line the values up incolumns, we can provide cout one of many stream manipulators *we must also #include the iomanip header |
|
setw |
* is used to set the width for the nextoutput cout << setw(5) << "a" This will print a with 4 spaces before it |
|
#include <string> |
*allows the use of string literals aka char arrays |
|
char c = std::cin.get()
|
*allows us to read multiple chars *can also be called and store the result in c: std::cin.get(c) |