Hi all,
ever frustrated by the unformatted output by cout<<..., turned out there
is a way to make formatted output from C++ ostream:
cout<<std::setw(8)<<"s"<<endl;
will give:
s
where the letter s takes up 8 charactors width.
unfortunately, this thing does not work in CINT as Root does not know how
to interpret "std::".
So I have made a wrapper in libBlast.so and checked into BlastLib2. it is
called Setw(). in your script, load libBlast.so and then do:
cout<<Setw(8)<<"s"<<" "<<Setw(10)<<3.14159<<"\n"
<<Setw(8)<<2.718<<" "<<Setw(10)<<"s"<<endl;
will give:
s 3.14159
2.718 s
it applies ofstream too so you can make formatted out put files.
Chi
This archive was generated by hypermail 2.1.2 : Mon Feb 24 2014 - 14:07:30 EST