Re: [ROOT] limitation in number of arguments in fscanf

From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Fri Dec 08 2000 - 14:28:56 MET


Hi, 

On Thu, 7 Dec 2000 11:08:27 -0600 (CST)
Muge Karagoz <karagozm@lotus.phys.nwu.edu> wrote
concerning ": [ROOT] limitation in number of arguments in fscanf ":
>
> Limitation: fscanf only takes upto 12 arguments FILE:make_ntuple.C LINE:17
> *** Interpreter error recovered ***

I suggest you use C++ ifstream instead  and use a for loop instead of
trying to read everything at once. 

> Could anyone please make me a suggestion?

See the attached examples. 

On Thu, 7 Dec 2000 14:46:19 -0500 (EST)
Eddy Offermann <eddy@rentec.com> wrote
concerning ": [ROOT] problem with ifstream ?":
> Hi Rooters,
> 
> I have some problems using "ifstream" in a macro.
> I tried to run basic.C in the tutorial after creating
> a file basic.dat with 3 (x,y,z) data points. It also
> seems to have problems because it prints thta 0 points were found.

You should include "fstream.h" in you script. It seems to me there's
an error in the basic.C example. Maybe something to do with assuming
that "fstream.h" is already loaded, or something. See the attached
example.  

Just do 

     root [0] .x foo.C 
     root [1] .x bar.C
     root [2] .x barz.C
      
Yours, 

Christian  -----------------------------------------------------------
Holm Christensen                             Phone:  (+45) 35 35 96 91 
  Sankt Hansgade 23, 1. th.                  Office: (+45) 353  25 305 
  DK-2200 Copenhagen N                       Web:    www.nbi.dk/~cholm    
  Denmark                                    Email:       cholm@nbi.dk








This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:38 MET