I am working with the following code:
#include <stdlib.h>
#include <string>
#include <iostream>
using std::cout;
using std::endl;
using std::flush;
int main()
{
long lng1 = 123;
long lng2 = 4567;
cout<<ltoa(lng1)<<ltoa(lng2)<<endl<<flush;
return 0;
}
Instead of receiving the output 1234567, I am receiving 1234123. This is on HP-UX 11.11. Another server, with the same OS, is producing the correct output. Is there a setting that I am missing? What is the cause of this problem?