If the client is MS-Windows and the server is *nix then you have Big Endian-Little Endian proglem The easiest way I know to correct it is to transfer the data as ascii text then use atol() or similar function on server side to convert back to integer in its own format.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
>> i am running this on unix by the way
if both client and server are on the same os (unix) then the problem is something else.
>> how do i change the integer into an ascii cod
c++ example, use stringstream class
#include <sstream>
...
...
stringstream stream;
int n = 123;
stream << n;
cout << stream.str();
c example
#include <stdio.h>
#include <string.h>
...
...
char buffer[80];
int n = 123;
sprintf(buffer,"%d", n);
printf("%s\n", buffer);
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343