Chapter 2 Flashcards
(36 cards)
//
single line comment
__
preprocessor directives
file contains code that allows C++ program to display output on screen and read input from keyboard; type of header file
iostream
displays screen output; a stream object; consule output
cout
used to organize names of program entities whose names are part of __ called __
namespace std
marks beg of main fcn
int main()
group of 1(+) prgrmming statements tht collectively has a name
function
all statements that make up fcn are enclosed in ___
left and right braces {}
”—-“, where — is a group of characters
string literal or string constant
marks end of complete statement
;
sends an integer value zero back to operating sys upon prgrm’s completion; indicates successful execution
return 0
works w/ streams of data
stream object
operator used to send messages to cout; stream insertion operator; item immediately to right will be sent
sends output to beg of next line for subsequent printing
endl, a stream manipulator
an alt way to do a newline
\n, an escape sequence
storage location in comp’s memory
variable
constant value that are assigned to variables; piece of data written directly into prgm’s code; common uses: 1) to assign a variable, 2) to display something on screen; aka constants
literal
tells compiler variable’s name and data type
variable definition
1) evaluates right hand side to single rvalue 2) assigns rvalue to left hand side that must be an lvalue (able to receive a value) 3) returns that value to context it was initiated in
assignment operator
prgmr-defined name that reps some element of a prgrm (eg: variable name); first character must be a-z, A-Z, or _; second can be all of the above and digits 0-9
identifier
numeric data types
integer and floating point
used to store individ characters, can only hold one character at time, can hold digits or letters; actually stored as integers (ASCII)
character
enclosed in single quotation marks, take one byte of memory
character literals
marks end of string, stored in last byte of memory of string literal
null terminator / null character
\0