Question: C Language. Warm Up 2. Symbol Table: Name Type Address integer1 int 0x7fff8c1ff994 p1 int * 0x7fff8c1ff988 p2 int ** 0x7fff8c1ff980 Memory Chunk (address on



C Language.
Warm Up
2. Symbol Table:
| Name | Type | Address |
| integer1 | int | 0x7fff8c1ff994 |
| p1 | int * | 0x7fff8c1ff988 |
| p2 | int ** | 0x7fff8c1ff980 |
Memory Chunk (address on the left, data on the right):
| 0x7fff8c1ff994 |
|
| 0x7fff8c1ff988 |
|
| 0x7fff8c1ff980 |
|
Fill in the above memory chunk table to reflect the changes that lines 6, 7, and 8 cause
In we substitute lines 10-12 with the following two statements, then what will be the output of the program?
Will the output be the same if we substitute the above two lines with the following two statements?
Will the output be the same if we substitute the above two lines with the following two statements?
Explain why the above outputs are the same or different from each other.
Consider the following program and answer the questions below.
What does variable p2 represent? Will this program successfully compile without warnings? Why or why not? (Try it!)
Arrays and Pointers
4. Compile and run the following program and answer the corresponding programs.
What is the output of the program?
What does array_of_integers evaluate to? If you dereference it, what value do you get? Try it.
Suppose we change lines 10-11 to the following:
Will the output change? Why or why not?
Suppose we change lines 13-14 of the original program to the following statements:
Will the output change? Why or why not?
Suppose we change lines 10-11 of the original program to the following statements:
Will the output change? Why or why not?
Now, does the variable ptr_of_array have the same value as the variable ptr_of_first_element? Why or why not?
Function and Pointers
What is the output of the following code?
Why? (i.e. show whats going on in memory)
CpSc 1111 Lab 12 Pointers Overview Pointers are an integral part of C and C++. While they may be the cause of many headaches, they allow for a great deal of control and flexibility. Because they are low-level constructs, they require a solid understanding of the memory model behind it all. Not every language has pointers, but what you learn about memory management will apply to most every language. Unlike most of your previous labs this semester, this one will not require you to write and submit a program. This lab is adapted from a lab used elsewhere, and it involves a good amount of guided self-exploration. We'll give you the right questions to ask along the way. Many of the questions will be open-ended, so when answering them, be sure to ask if you are not 100% sure what's going on! Please use the answer sheet provided. You will submit the answer sheet to the handin page. You may work individually or in groups of no more than 3. The code snippets here are screenshots, so you won't be able to copy and paste them (sorry!) but they're short enough to type This lab will give you the opportunity to Understand and use pointers and pointer operations Discover the relationship between arrays and pointers plore passing pointers as functi on parameters Warm Up First, let's practice with pointers to basic C data types and some related pointer operations. We'll see referencing, dereferencing, and arithmetic operations. 1. Compile and run this program: 1 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
