When you use pointers in an assignment operation, you must ensure that the types of the pointers in the operation are compatible.
The following example shows compatible declarations for the assignment operation:
float subtotal; float * sub_ptr; /* ... */ sub_ptr = &subtotal; printf("The subtotal is %f\n", *sub_ptr);
The next example shows incompatible declarations for the assignment operation:
double league; int * minor; /* ... */ minor = &league; /* error */
Related References