yes, this is another pointer question
ok, here's my code:
Code:
#include <iostream.h>
#include <math.h> //edit, forgot to add this :)
void ModifyPointer(double* value, bool*ok) // forgot the void, too
{
value=sin(45);
ok=true;
}
void main()
{
double temp1;
bool temp2;
ModifyPointer(&temp1,&temp2);
cout << temp1 << " is " << temp2 << endl;
}
now, theoretically, that would make it so that temp1 and temp2 are equal to sin of 45 and true (respectively). Thing is, when I try and compile this, it returns an error:
error C2440: '=' : cannot convert from 'double' to 'double *'
and that ONLY happens for the sin one, it doesn't happen for the bool one. Now, i've tried MANY things (from reinterprets, to just plain (double *), and none of the options i've tried so far have worked....)
so i need to know why this isn't working, and how i can fix it.
NOTE: the above isn't my actual code, it's just pseudo code in case you haven't noticed, but it should compile and generate the error i think
thanks in advance.