Day 3 Flashcards
Define Stack:
memory used by non-static local variables explicitly declared in a program
Define Freespace:
Memory set aside for stack, heap, and other uses
Define Heap:
- Dynamically allocated memory that is uninitialized at first.
- Slower than slack
Define BSS:
- Holds global and static variables that are uninitialized or initialized to 0.
- Exist throughout life of program
Define Data:
- Holds global and static variables initialized to a non-zero value.
- Exist throughout life of program
Define Text (memory layout):
• Stores compiled code of the currently running program.
Rules of Identifiers:
- Can only contain letters, numbers, and underscores (_)
* Cannot start with a number or be a syntactically reserved keyword of language
Variable initialization
= ;
What is an assignment operator?
Assigns a value to a variable.
Stream insertion variable vs. stream extraction operator?
Insertion = «_space;(cout) and extraction =»_space; (cin)
Programs 4 structural components
- Declarations – provides storage for the data a program is working with.
- Input – Allows acquisition of data from a source. Without it, program would only work with one set of data
- Processing- Process of manipulating the data in some manner to arrive at a result.
- Output- proves the processed data to a final destination, which could be a monitor, file on hard drive, or a network resource such as web page.
Define: Expressions
Combination of operators and values.
Define: Statements
Very common to see (;) following a statement.
Define: Code Blocks
Useful when statements require regrouping. Enclosed in {} curly braces
Explain: Comments
Single line comment // - compiler ignores everything after the comment until end of the line.
Multiple Line Comment /* */ - compiler ignores everything between opening and closing
What two terms are associated with Strings?
Index- the position in a string []. First index would be 0.
Element- an association to a position in string using a human recognized format. First element in array would be 1.
String is a special container object that can hold multiple characters.