Re: [ROOT] iostream

From: Valeriy Onuchin (Valeri.Onoutchine@cern.ch)
Date: Mon Sep 29 2003 - 15:00:43 MEST


 Hi  zhou, dong
please, always specify  platform - compliler and ROOT version.

Thanks. Regards. Valeriy




  ----- Original Message ----- 
  From: Dong Zhou 
  To: roottalk@pcroot.cern.ch 
  Sent: Monday, September 29, 2003 2:04 PM
  Subject: [ROOT] iostream


  dear rooters:

  i feel there is something wrong with the 'fin >>' method.

  my code is like this:
  // tmp.cpp
  void tmp(){
  ofstream fout ("tmp.dat");
  Double_t arr;

  for(int i=0;i<3;++i){
   fout << i*0.1;
  }
  fout.close();
  ifstream fin("tmp.cpp");
  for(i=0;i<3;++i){
   fin >> arr;
   cout << i << ' ' << arr << endl;
  }
  }

  it should be 0 0.1 0.2
  but the output turns out to be 0.1 0.2 0.2
  it seems that it take 00.1 as 0.1

  i am not sure if i have made any mistake. what is ur opinion?
  thank u.

  zhou, dong




------------------------------------------------------------------------------
  Do You Yahoo!?
  启用电邮帐号,领会雅虎通[身临其境聊电影]的动感魅力,还有网络摄像头+雅虎通收音机等你来拿



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:15 MET