In this project, our main goal is to understand how to create and delete pointers using dynamic memory allocation operators.
Create a pointer of type double and perform the following operations on it.
- Declare a pointer of type double using the (new) dynamic memory operator.
- Assign a value to the pointer.
- Print the pointer value.
- Delete the pointer value using the (delete) dynamic memory operator.
#include <iostream>
using namespace std;
int main(){
/*
Add your code here
1. declare a double pointer using the (new) dynamic memory operator
*/
/*
Add your code here
2. Assign a value to the double pointer;
*/
/*
Add your code here
3. print the pointer value
*/
/*
Add your code here
4. delete the pointer value using the (delete) dynamic memory operator
*/
return 0;
};