I have:
void *abc;
int *abc2;
int someInt = 5;
int *intPtr = &someInt;
abc = intPtr; // This line is ok without casting
abc2 = abc; // Here will be an error without casting
Why is this?
I have:
void *abc;
int *abc2;
int someInt = 5;
int *intPtr = &someInt;
abc = intPtr; // This line is ok without casting
abc2 = abc; // Here will be an error without casting
Why is this?
In C language both assignments (both lines) are perfectly OK without casting.
The second line would produce an error in C++, but your question is tagged C. Your assertion about an error on the second line is false.