Question: Pointers Worksheet (C++) Name: ________________________________________________ Create an integer variable called val Create a pointer called p Create a pointer called q Name Value Mem Address

Pointers Worksheet (C++)

Name: ________________________________________________

Create an integer variable called val

Create a pointer called p

Create a pointer called q

Name

Value

Mem

Address

100

104

108

112

116

120

124

128

132

Assign 4 to val

Make p point to val

Make q point to what p points to

Name

Value

Mem

Address

100

104

108

112

116

120

124

128

132

Write code to make val display its address

Write code to make p display the value of the variable it points to

Use p to change the value of val to 10

Name

Value

Mem

Address

100

104

108

112

116

120

124

128

132

Make q point to nothing

Which of the following statements are syntactically correct?

  1. val = p;
  2. q = &val;
  3. *p = val;
  4. *p = *q;
  5. *p = &val

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!