Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CpSe 1111 Lab 12 Pointers Overview Pointers are an integral part of C and C+. While they may be the cause of many headaches, they

image text in transcribed
image text in transcribed
image text in transcribed
CpSe 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 roquire 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 workindividually or in groups of no more than3 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 . Explore passing pointers as function parameters Warm U First, let's practice with pointers to basic C data types and some related pointer operations. We'll see referencing. dereferencing, and arithmetic operations. I. Compile and run this program: 1 #include stdio.h> 3 int main(int argc, chare argvl) int integerl, pi. *p2: integer! 10; pl-&integerl; 10 printf("integerl= td ". integer!) ; 11 printf pl Spn". pl): 12 printf p2 pin", p2) 13 return : 2. Suppose after the declaration of the variables on line 4, we have the following: Symbol Table: Name ype int x7fft8cift994 XTEFF8c115988 int Memory Chunk (address on the left, data on the right 0x7fEtBciff994 0x7fff8cif1988 0x7fff8c1ff980 a. Fill in the above memory chunk table to reflect the changes that lines 6,7, and 8 cause

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions