Based on the program here, I changed just more line, everything else is the same
In batch mode, I don’t get the random sequence of 1s and 0s that I wanted, but if I run at the root prompt, I could. How can I sort this out?
#include <iostream>
using namespace std;
void testRoot(){
int i=0;
do{
cout << rand()%2 << "\t";
i++;
}while(i!=10);
}
output at root prompt :
0 1 1 1 1 0 0 1 1 0 root [1] .x testROOT.C
1 0 1 1 0 0 0 0 0 1 root [2] .x testROOT.C
0 1 1 0 0 0 1 1 1 1 root [3] .x testROOT.C
0 0 0 1 1 1 0 1 0 1 root [4] .x testROOT.C
1 1 1 0 1 0 0 1 0 1 root [5] .x testROOT.C
0 1 0 0 1 0 0 0 1 1 root [6] .x testROOT.C
1 0 1 0 1 0 1 1 1 0 root [7] .x testROOT.C
1 0 1 0 1 0 0 1 0 1 root [8] .x testROOT.C
0 0 0 0 0 1 1 0 1 0 root [9] .x testROOT.C
output as a batch program :
(c) 1995-2014, The ROOT Team |
64 | Built for linux |
65 | From heads/master@v6-05-01-352-g03db581, Sep 15 2015, 14:48:39 |
66 | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
67 ----------------------------------------------------------------
68
69
70 Processing testROOT.C...
71 0 1 1 1 1 0 0 1 1 0 ----------------------------------------------------------------
72 | Welcome to ROOT 6.05/01 http://root.cern.ch |
73 | (c) 1995-2014, The ROOT Team |
74 | Built for linux |
75 | From heads/master@v6-05-01-352-g03db581, Sep 15 2015, 14:48:39 |
76 | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
77 ----------------------------------------------------------------
78
79
80 Processing testROOT.C...
81 0 1 1 1 1 0 0 1 1 0 ----------------------------------------------------------------
82 | Welcome to ROOT 6.05/01 http://root.cern.ch |
83 | (c) 1995-2014, The ROOT Team |
84 | Built for linux |
85 | From heads/master@v6-05-01-352-g03db581, Sep 15 2015, 14:48:39 |
86 | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
87 ----------------------------------------------------------------
88
89
90 Processing testROOT.C...
91 0 1 1 1 1 0 0 1 1 0 ----------------------------------------------------------------
And also I would like to suppress the root banner.