Write your program in
pointer.c. Can two pointers point to the same thing?
Write your program in
pointer2.c. Fill in the memory table below to represent just after the linesum = (*intPtr) + (*intPtr2);In your memory diagram, use the actual addresses printed to the screen. You might need to add extra print statements to find them out.
Globals:
| Address | Name | Contents |
|---|---|---|
| i | ||
| j | ||
| sum |
Stack:
| Address | Name | Contents |
|---|---|---|
| intPtr | ||
| intPtr2 | ||
| intPtr3 |
(For markdown table formatting help, see: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#tables)
Write your program in
charpointer.c.
Write your program in
pointertopointer.c. Fill in the memory diagram below just after the printf. Use the actual addresses from your program.
Stack:
| Address | Name | Contents |
|---|---|---|
| i | ||
| p | ||
| p2 |
Write your program in
string.c.
Write your program in
string2.c. Explain what these lines are trying to achieve.
Paste your output here
Write your programs in
array.candarray2.c. What is the output for each program?
Write your program in
array3.c
You do not need to submit your diagram. Explain where
B[1][3]is located in your diagram and how the calculation for its address works.
Write your code in
sizeof.c. What is printed out by the program? Fill in the memory diagram below for the point right before the calls to free. You may need to modify the program to print more addresses.
Stack:
| Address | Name | Contents |
|---|---|---|
| doublePtr | ||
| charPtr |
Heap:
| Address | Contents |
|---|---|
Write your code in
pointerArith.c.
Paste your output here
Write your code in
pointerArith2.c.
Write your code in
pascal.cWhat is your program's output whensize=10?
Paste your output here
Write your code in
pascal2.c
What is the decimal value of the number 1ABE?
Convert the decimal number 8384 into hexadecimal.
Use the hex version of 8384 to write that as a binary number, leaving spacing between every four bits.
Without writing the program, can you predict what it will print? Confirm your answers with the program's output.
Write your code in
endian.c
Modify
endian.c. to print the addresses of all the variables. Then draw a detailed memory diagram like the one we've shown above, but using the actual memory addresses from the execution of your program. Look up the terms little- and big-endian and explain their origin.