Cout not working with ROOT 6

Hi All,

I am trying to output a simple string on the screen using cout in ROOT 6.06. When I do it via a script and run it as .x script(), it doesn’t show. However, when I write the command on the ROOT 6.06 prompt, it works.
Any ideas?

Thanks in advance,


Could you try with this short code?


void coutTrial(std::string message=“hello world!”)
std::cout << message.c_str() << std::endl;
std::cerr << message.c_str() << std::endl;

Also, do you receive any (error) message from the interpreter?


…and otherwise: what’s the code and the file name that shows this behavior? We’ll need more info.


Sorry for the late reply.
Thanks atd for the code. I tried it and it works. It seems there is something wrong with my code that is preventing cout from working!!
Axel, I will look closely into this and if I can’t figure it out, I will sent you the script so maybe you can check it yourself. I have recently switched to ROOT 6 and I think there are some scripts that do not work in 6 that used to work in 5.
Thank you again.