Primer Flashcards
switch
allows a variable to be tested for equality against a list of values or case, must have integral or enumerated type
translational unit
basic unit of compilation, consists of a single source file plus header files, complied into object files that are joined together by the linker
object file
a single translation unit can be compiled into this
static limits
scope to the translation unit, static objects in a source file are not accessible outside their source file
file scope
global, declared outside of any function, structure or union declaration, begins right after its declaration and runs to the end of the translation unit
block scope
a name if it’s declared within a function, scope begins right after its declaration and runs to the end of the block immediately enclosing that declaration
function prototype scope
declared in the function parameter list, scope begins right after its declaration and runs to the end of the parameter list
function scope
ONLY statement labels, can be defined only in the body of a function and scope is everywhere in that body, even before the label has been defined
lifetime
the time duration where an object/variable is in a valid state
conditional (ternary) operator
(condition) ? (if true) : (if false);
reference variable
a variable that references an object (alias), once declared it cannot be changed to reference a different object, has the same memory address as the item it references
array
a sequence in memory of like items, NOT data types, size must be explicit at complementary time and memory is allocated at complementary time, an array name is the address of its first element
stream
entity where a program can either insert or extract characters, console is represented by cin and cout, output files can be formatted using I/O manipulators
Computer Memory
Writable or non-writable, Executable or non-executable, Initialized or uninitialized.
Stack
Managed automatically by compiler (writable, non-executable).