119k views
3 votes
The variable dp is to refer to an array of double. Assuming the integer variable n has been assigned a value, declare dp appropriately, allocate an array of n doubles and assign the resulting pointer to dp.

1 Answer

1 vote

Answer:

double × dp = NULL ;

int n;

n = <some value> ;

dp = new double[n]

Step-by-step explanation:

According to the given question, the relevant data provided is as follows

Variable dp = Array of double

Based on the above information,

The allocation of an array for doubling n and assigned it to dp is here below:

double × dp = NULL ;

int n;

n = <some value> ;

dp = new double[n]

Hence, the above is the answer

User Johnbot
by
5.5k points