Lecture 5 Flashcards

(4 cards)

0
Q

Values:

  1. What are values?
  2. Why are values important for programming?
A
  1. ~data
    ~ could be real number, integer, or character
    ~ things you have been storing in your variable
  2. ~programs ultimately have to interact with some sort of value
    ~ values are important to humans
    ~ processing values (data) are what makes programs important
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

Addresses:

  1. What are addresses?
  2. Why are addresses important for programming?
A
  1. ~Location for computer memory.
    ~ It’s an overly simplified explanation but that’s all you need to know.
  2. ~The C programming language allows the programmer the flexibility to manage memory
    ~ Having a high level of control over memory allows C programming to be more efficient and take up less memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Addresses vs Values:
1.
2.

A

1.

2.

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

Reference and Dereference Operators:

  1. Reference operator |&|
  2. De-reference operator |*|
  3. Pointers
A
  1. |&value_variable| ~ “address of” value_variable
  2. |*pointer_variable| ~ “value pointed but” pointer_variable
  3. ~ int *pointer_variable : declare pointer_variable as a pointer to an object of type int
    ~ in programming, variables can store integers, real numbers, characters, or addresses
    ~ pointers are variables that store an address
    ~ pointers are usually used in conjunction with the de-reference operator *
    ~ pointers are just variables used in a specific way
How well did you know this?
1
Not at all
2
3
4
5
Perfectly