formatting streams

From: Lee, Kerry T. \(JSC-SF\)[LMIT] <>
Date: Thu, 9 Nov 2006 12:46:33 -0600

Dear Rooters (but most likely this is for Masa)

I am using ROOT version 5.13.01 on a linux box with gcc 3.4.4.

When executing fomatting commands of streams on the CINT command line, some work and others don't. Here is an example:

root [0] #include <iomanip>
root [1] double a = 2.0
root [2] double b = 1.1
root [3] cout<<std::setw(10)<<a
         2(class ostream)116863616

root [4] cout<<std::showpoint<<a
0xbe80362(class ostream)116863616
root [5] cout<<std::showpoint<<b
0xbe80361.1(class ostream)116863616

There is a workaround by using cout.setf(), but this is not as nice as doing "on-the-fly" formatting.

root [6] cout.setf(ios::showpoint)
root [7] cout<<b
1.10000(class ostream)116863616
root [8] cout<<a
2.00000(class ostream)116863616

Is it possible to include the other formatting manipulations to work like the std::setw() command on the CINT command line?

Kerry Received on Thu Nov 09 2006 - 19:47:00 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:01 MET