How to make a variable type?

Hello! I started working with root recently. How to make a variable type? I did int N = 30, but long (N) didn’t work (as and (long) N).


_ROOT Version:_6.19/01
Platform: Ubuntu
Compiler: Not Provided


ROOT Primer -> ROOT Basics
ROOT User’s Guide -> A Little C++

Hi @Svyatoslav,
welcome to the ROOT forum! I’m not sure I understand the question – is it related to ROOT?

Indeed Wile’s links might help with learning the ropes of C++.

At the ROOT prompt, that you start with the command root, you can quickly test C++ snippets:

root [0] int N = 30 // ok
root [1] long int N2 = 42 // ok
root [2] auto N3 = long(N) // ok

Cheers,
Enrico

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.