static
wxFloat64 TestFloatRW(wxFloat64 fValue)
{
- wxFileOutputStream* pFileOutput = new wxFileOutputStream( wxT("mytext.dat") );
- wxDataOutputStream* pDataOutput = new wxDataOutputStream( *pFileOutput );
-
- *pDataOutput << fValue;
+ {
+ wxFileOutputStream pFileOutput( wxT("mytext.dat") );
+ wxDataOutputStream pDataOutput( pFileOutput );
- delete pDataOutput;
- delete pFileOutput;
+ pDataOutput << fValue;
+ }
- wxFileInputStream* pFileInput = new wxFileInputStream( wxT("mytext.dat") );
- wxDataInputStream* pDataInput = new wxDataInputStream( *pFileInput );
+ wxFileInputStream pFileInput( wxT("mytext.dat") );
+ wxDataInputStream pDataInput( pFileInput );
wxFloat64 fInFloat;
- *pDataInput >> fInFloat;
-
- delete pDataInput;
- delete pFileInput;
+ pDataInput >> fInFloat;
return fInFloat;
}