Lecture 5 Flashcards
(4 cards)
0
Q
Values:
- What are values?
- Why are values important for programming?
A
- ~data
~ could be real number, integer, or character
~ things you have been storing in your variable - ~programs ultimately have to interact with some sort of value
~ values are important to humans
~ processing values (data) are what makes programs important
1
Q
Addresses:
- What are addresses?
- Why are addresses important for programming?
A
- ~Location for computer memory.
~ It’s an overly simplified explanation but that’s all you need to know. - ~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
2
Q
Addresses vs Values:
1.
2.
A
1.
2.
3
Q
Reference and Dereference Operators:
- Reference operator |&|
- De-reference operator |*|
- Pointers
A
- |&value_variable| ~ “address of” value_variable
- |*pointer_variable| ~ “value pointed but” pointer_variable
- ~ 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