Then crash. By the way, I can get a char-type variable via cout:
root [0] char y = 'a'
root [1] cout << y
The last sequence of commands proceeds fine (see the screenshot).
The issue is not limited to cout command, I have troubles with i/o in general. For example, ifstream infile(“here is a file name”) doesn’t go well.
Probably Windows 7 is not supported by the current ROOT version? Should I use older versions?
.
The strange detail is that cout >> [here are non-char-type variables] proceeds okay on rare occassions (code is same). No clue what does it depends on.
It might be due to an incompatibility between your version of Visual Studio (16.10.3) and the one used to build ROOT (v16.3.10). I see no problem with ROOT v6.24.02 on a machine with VS v16.4.6:
C:\Users\bellenot\Downloads>root
------------------------------------------------------------------
| Welcome to ROOT 6.24/02 https://root.cern |
| (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for win32 on Jun 28 2021, 09:28:51 |
| From tags/v6-24-02@v6-24-02 |
| With MSVC 19.23.28107.0 |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
root [0] int x = 10;
root [1] cout << x;
10
root [2] char y = 'a';
root [3] cout << y;
a
root [4]
(It’s a screenshot of processing command window. I forget to make more screenshots for the final state of output).
Command cout << 5 caused a crash.
_
After that I deleted my Visual Studio Community and uploaded trial Visual Studio Professional v16.4.6 (MSVC v14.24.28319.0). Executing pre-compiled ROOT v6.24.02 with Visual Studio v16.4.6 caused the same error (cout << 5 crashes the command window).
So I built from source (Visual Studio v16.4.6). Results:
I asked a person with Windows 10, Visual Studio v16.10.2, MSVC v19.29.30038 to try pre-compiled ROOT v6.24.02. It worked well (typing cout << 5 didn’t cause crash).
So there is something on your system causing the issue. I’m sorry, but since Windows 7 is not supported by Microsoft anymore, we don’t have any Windows 7 machine to debug this…