Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

5-50. Based on the information, I think we should buy the property.

Answered: 1 week ago

Question

5-49. Lying on the shelf, Ruby saw the seashell.

Answered: 1 week ago