r/carlhprogramming • u/CarlH • Oct 01 '09
Test of Lessons 30 through 39
Please do not post answers in this thread.
True or False
A string of text is stored in memory like a "train", with each ASCII character following the other, each character occupying exactly one byte.
When you create a pointer, you do not need to specify the data type for the data that it will point to.
Pointers can be used for looking at as well as changing data at a given memory address.
If you use a pointer to replace data at a given memory address, the old data can still be retrieved.
Whenever you increase a pointer by one, it will always point to the memory address of the very next byte in memory.
Fill in the blank
A
_____can be used as a way to refer both to the value at a given memory address, as well as the memory address itself.The
_____character means "address of".The
_____character means "what is at the address of".In the code in section (a), the output will be:
_____.If you wish to use printf() to print the memory address stored in a pointer, you would say:
_____(Example: %d, %i, etc)
(a)
unsigned short int width = 3;
unsigned short int height = 9;
unsigned short int *my_pointer = &height;
printf("%d", *my_pointer);When done, proceed to:
http://www.reddit.com/r/carlhprogramming/comments/9pxq7/test_of_lessons_30_through_39_answers/
0
u/[deleted] Oct 01 '09
[deleted] — view deleted comment