I have tried searching about this but without luck. I have read about pointers and used them and I know that pointers to non-class types are only compatible with the same pointer type, like
int* apointer = anotherintpointer;
but this is not possible(not without any explicit conversion)
int* apointer = aFLOATpointer;
I do see the point in not allowing this, but not totally. Like, integers are compatible with floating-points, like int x = afloatvariable;
, so why should pointers to int not be compatible with pointers to float?
My main question is: Is there any place where I can read about why those pointers are only compatible with the same pointer type and a place that actually states that this is true, because it is just an assumption from my experience. If you can read about this in the standard, please give me a hint where to read, because I could not find it when I quickly skimmed it. So if anybody could provide me a link or something, it would really be more than awesome.
Edit: Based on the comments, I can see that my use of the word compatible is maybe a little off. What I mean by compatible is that one type is allowed to be assigned another :)