Yesterday I was in class, and at some point the instructor was talking about C code. He said:
What is the purpose of making a pointer cast in C? The only
Casting for pointers is essential to say the compiler how to perform pointer arithmetic.
For example if x is a character pointer pointing to memory 2001, x++ should go to 2002, but if x is an integer pointer x++ should be 2003
so if type casting is not done for pointers compiler won't be able to perform pointer arithematic properly.