Day 3 Flashcards

1
Q

Define Stack:

A

memory used by non-static local variables explicitly declared in a program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define Freespace:

A

Memory set aside for stack, heap, and other uses

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Define Heap:

A
  • Dynamically allocated memory that is uninitialized at first.
  • Slower than slack
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Define BSS:

A
  • Holds global and static variables that are uninitialized or initialized to 0.
  • Exist throughout life of program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define Data:

A
  • Holds global and static variables initialized to a non-zero value.
  • Exist throughout life of program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define Text (memory layout):

A

• Stores compiled code of the currently running program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Rules of Identifiers:

A
  • Can only contain letters, numbers, and underscores (_)

* Cannot start with a number or be a syntactically reserved keyword of language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Variable initialization

A

= ;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is an assignment operator?

A

Assigns a value to a variable.
Stream insertion variable vs. stream extraction operator?
Insertion = &laquo_space;(cout) and extraction =&raquo_space; (cin)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Programs 4 structural components

A
  1. Declarations – provides storage for the data a program is working with.
  2. Input – Allows acquisition of data from a source. Without it, program would only work with one set of data
  3. Processing- Process of manipulating the data in some manner to arrive at a result.
  4. 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Define: Expressions

A

Combination of operators and values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Define: Statements

A

Very common to see (;) following a statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Define: Code Blocks

A

Useful when statements require regrouping. Enclosed in {} curly braces

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Explain: Comments

A

Single line comment // - compiler ignores everything after the comment until end of the line.
Multiple Line Comment /* */ - compiler ignores everything between opening and closing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What two terms are associated with Strings?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a getline()?

A

Reads all data (including whitespace) up to the newline.

When you see this anywhere THINK INPUT (IN!!!!!!)

17
Q

What is ws()?

A

Removes leading whitespace from the specified input stream. Placed prior to getline. When using getline and cin

18
Q

What is Concatenation?

A

Process of joining two or more strings together.

19
Q

What are the different methods of strings?

A
  1. Size() – determines how many bytes make up a string
  2. At() – return character in string using index number
  3. Find() – find first occurrence of sub-string in called string
  4. Compare() – compare string object to string passed as argument
  5. Empty() – test if string is empty. Returns true if empty, false if not
20
Q

What are the different escape characters?

A
  1. \n – newline
  2. \t – tab character
  3. \0 – null character
  4. \” – double quote character
  5. \ - single backslash character
21
Q

What are raw string literals?

A

Make each character in the string literal, meaning escape characters are not processed