You should use ntohl, which has the advantage that it will do the right thing (nothing) if your code ever get to run on a big-endian system.