Could somebody please elaborate on the differences?
(int) foo compares most to c++ reinterpret_cast, i.e. no checks on the validity of the cast.
reinterpret_cast