#include <iostream>
using namespace std;
int *getDouble(int* x){
int *result = new int ((*x) * 2); // save the result in the heap
return result; //return the address of the result
}
int main(){
int x=5;
int *ptr = getDouble(&x); //the pointer points to the result address
cout<<*ptr<<endl;
}