I can't wrap my head around why does the following lines give ``initialization from incompatible pointer type'' in gcc:
int num = 10;
int *p = (char *) #
Why isn't it clear to the compiler that I want this (when I do this, warning message goes away):
int num = 10;
int *p = (int *) (char *) &num ;
If the following is OK:
char eu = (short) 10;
And we don't need to do that:
char eu = (char) (short) 10;
then why do we need to add a base type explicitly in pointer definition?