Week 2 (Intro to C++) Flashcards
What is the std namespace
namespace for iostream
\a
alarm (beep)
When are semi colons to be used
At the end of complete statements
What does the return of the main function do?
sends integer value 0 when program executed successfully
{ }(name and description)`
Open and closing braces, Encloses a group of statements such as the contents of a function
What denotes the beginning of a function
() for argument followed by a {
what type of object is the cout object
stream object
What are constants
data items, values can not change
what is the << called
Steam insertion operator
What is the skeleton for definition / declaration:
dataType variableName(identifier) ;
What is the keyword for a boolean
bool
Syntax for an Assignment Statement
variableName = expression;
How do you not confuse double long with int long
add L to the end of the floating point number
What are Variables
storage locations in memory
What is the skeleton of a function
returnType functionName () { }
When does a preprocessor directive act?
Before you compile
what operator can determine size?
sizeof()
What is a return type
type of value function sends back when done executing
What does a namespace do?
Organize names for variables, functions, and objects
What is an assignment statement
Sores a value in a variable
What follows a double slash (//)
Comment
What does a preprocessor directive do?
“Sets up” your source code (Header File)
What is the text inside double quotes called
String Literal
What happens when you put a double into an integer?
Truncate, loss of data.
What is the difference between standard and prestandard header files
Prestandard header files included a .h at the end. Example:
What follows #include
Preprocessor Directive
\r
Return (cursor to go to the beginning of the current line)
What does the include directive do
causes another file to be inserted into your program (not part of C++ core language, not seen by C++, commands to preprocessor, no semi colon)
\t
horizontal tab (skips to next tab stop)
( ) (name and description)
Open and closing parentheses, Used in naming a function, as in int main()
what is the symbol for the include directive
(pound sign)
What is an example of a variable declaration / definiton?
int age;
What does a variable definition / declaration do?
Assigns an identifier to a location in memory (variable)
” “(name and description)
Open and closing quotation marks, Encloses a string of characters, such as a message to be printed on the screen.
\n
newline (cursor to next line)
(name and description)
Pound sign, Beginning of a preprocessor directive
; (name and description)
Semi colon, Marks the end of a complete programming statement.
What is an Identifier
Names for variables
Why is the header file included?
for input / output
what are the two ways to add a line
endl AND “\n” (use quotes for \n)
What do include for string
include
// (name and description)
Double slash, Beginning of a comment
\b
Backspace (causes the cursor to move left one position)
What is iostream for?
Input and output
What can the first character of an identifier have to be?
letter or underscore
< > (name and description)
Open and closing brackets, Encloses a file-name when used with the # include