BorlandDave
Programmer
I've got a pointer to a double set up like this:
double aValue;
double *aValuePointer;
aValuePointer = (double *) &aValue;
I can pass this pointer to a function which expects a double using aValuePointer[0]. But the problem is I want to copy this pointer to a new one. I thought I could just declare a new one and make it equal to the first one, but that doesn't work. This is what I tried:
double *aValuePointer2;
aValuePointer2 = aValuePointer;
I tried passing this to the same function using aValuePointer2[0], but I keep getting an error.
Can anyone help? Cheers.
double aValue;
double *aValuePointer;
aValuePointer = (double *) &aValue;
I can pass this pointer to a function which expects a double using aValuePointer[0]. But the problem is I want to copy this pointer to a new one. I thought I could just declare a new one and make it equal to the first one, but that doesn't work. This is what I tried:
double *aValuePointer2;
aValuePointer2 = aValuePointer;
I tried passing this to the same function using aValuePointer2[0], but I keep getting an error.
Can anyone help? Cheers.