Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

q 4 b (b) The following questions are based on the C++ code as shown in Figure Q4(b). struct chain char a; chaint n; };

image text in transcribedimage text in transcribed

q 4 b

(b) The following questions are based on the C++ code as shown in Figure Q4(b). struct chain char a; chaint n; }; chain* px, py; px = new chain; px a= 'B'; px n = NULL; py = new chain; py a= ''; py n-px; px = NULL: Figure Q4(b) (1) Specify how many dynamic variables are created after px = NULL is executed. [2 marks] (ii) Specify what is the content of px variable after px = new chain is executed. [2 marks] 111 Specify what is the content of px variable after px = NULL is executed [2 marks] (iv) Draw the relationship between TWO (2) variables px and py after all statements in Figure Q4(b) is executed. [2 marks]

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