
February 24th, 2005, 01:58 PM
|
|
Registered User
|
|
Join Date: Feb 2005
Posts: 1
Time spent in forums: 24 m 9 sec
Reputation Power: 0
|
|
Hp-Unix .write issues
This code:
Code:
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
int main()
{
ofstream outfile( "Cpp_DP", ios::binary | ios::trunc );
const double pie = 3.1415;
outfile.write ( reinterpret_cast< const char * >( &pie ), sizeof( pie ));
outfile.close();
return(0);
}
runs fine on a Linux machine. On a HP-Unix machine, it creates the file,
but it puts nothing into it. I'm using the same compiler, g++, for both
systems. Does anyone have any ideas on why this is and/or what I
should do to fix it.
|