I'm currently working on a project that uses a pointer to capture and then display and long int value entered by the user. When entering the value 2140118959 I receive Af 9f 8f 7f, I'm looking to get 7f 8f 9f Af. I know this is because of little endian format. Hints?
You can use the (non-standard-c, but widely available) function "htonl" to make sure your integers are in big-endian. The plus is, that it won't do anything to your integer if you are already running on a machine with big-endian storage.
On linux, its in netinet/in.h. On windows, include winsock2.h.