Why does the following code write four bytes when run on my local Windows machine using Visual C++, yet writes 4 extra 0 bytes when I upload to my school's Unix server?
unsigned long temp = 1025;
ofstream file("test", ofstream::binary);
file.write((char*)&temp, sizeof(temp));
Here is the result using xxd locally: 0104 0000
Here is the result on the Unix server: 0104 0000 0000 0000
Is this a problem with what mode I am opening the file in?