The compiler will throw an error because it's illegal to assign a pointer-to-emp1 to a pointer-to-int. So the cast is needed to override the compiler's check. Were it not for that check then your suggested code would be fine.

NB: only use casts where you really know what you're doing. Using casts to solve compiler errors/warnings is not a good general solution.