Originally Posted by
swoopy
>How can I prove that a1,a2 and a3 are of the same type?
By looking at how they are declared. As a simple example, if a and b are declared as int, they are of the same type. If a is declared as an int, and b as a double, they are of different types.
If you are asking is it possible to prove a and b are of the same pointer type without looking at the declaration, then you can when you compile the program, but not when you run the program. If a and b aren't of the same pointer type, then following line will generate a warning something like "comparing incompatible pointer types".
I ran this code:
Code:
if(a1 == a2)
printf("Equal %i",a1==a2);
else
printf("Not Equal %i\n", a1 != a2);
and it came back saying not equal, but this doesnt prove that they are of the same type.