Question: C++ 1) Pointer basics a) Declare two (type double) pointer variables named d_var and d_array: b) Write C++ statements to dynamically create a double-precision floating-point

C++

1) Pointer basics

a) Declare two (type double) pointer variables named d_var and d_array:

b) Write C++ statements to dynamically create a double-precision floating-point variable and store its address in d_var. Also dynamically create an array of 10 double-precision floating-point values and store its address in d_array:

c) Write C++ statements to input a value for d_var (i.e., a value that d_var points to) from the console and then display it:

d) Write C++ statements to initialize the 10 double values in the dynamically allocated array to 1.0 :

e) Now write C++ statements to de-allocate the memory (i.e. using the delete operator) pointed by d_var and d_array

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!