save memory by using the same memory region for storing different objects at different times

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/7

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

8 Terms

1
New cards

const

keyword is a way to declare that a variable's value will not change

2
New cards

const keyword can also be used for function parameters to indicate

that a
function promises not to change a value
• Allows for clearer documentation of the implementation of a function
• Allows programmers to assume a function won't change a variable's value

3
New cards

int * const p = &h2g2; means

p always points to &h2g2

4
New cards

const int *p = &h2g2; means

p points to a const int

5
New cards

const int * const p = &h2g2;

p always points to a const int

6
New cards

clockwise or spiral rule to convert a declaration to a sentence

1.Take the name of the variable: "var is"
2. Replace [X] with "array X of" (or
replace [] "array undefined size of"
3. Replace function parameters (type1,
type2) with "function passing type1
and type2 returning..."
4. Replace * with "pointer(s) to"
5. Replace const with "constant"

7
New cards

use the clockwards spiral rule to turn this into a sentence: char * str[10]

str is an array 10 of pointers to a char

8
New cards

const int * const d;

d is a constant pointer to an int constant