I am getting an error during the calculation of "n"?? For the;
Code:
n=(int*)Posn;
and
n=(int *)Posn;
I am seeing an error "a value of type "int *" cannot be assigned to an entity of type "int" ?? Any ideas?
Printable View
I am getting an error during the calculation of "n"?? For the;
Code:
n=(int*)Posn;
and
n=(int *)Posn;
I am seeing an error "a value of type "int *" cannot be assigned to an entity of type "int" ?? Any ideas?
n is an int, so obviously you can't assign an int* to it. You might try n = *(int*)Posn, but as has already been pointed out, there may be alignment problems since, for example, a 4-byte int often needs to begin on a 4-byte boundary, whereas a char array could possibly begin anywhere. You could try the enum idea to ensure proper alignment.