This question is in reference to the code on page # 9 of [interference] the link.
I wrote the code in C++ exactly the way it is given in the manual. However, this code does not have a main method, and I was doubtful if it would work, and it did not. The error I got is “Function main() is not defined in current scope”.
Naively, I thought changing void slits() to int main() would help, but it did not, and the new error I am getting is “Symbol nslit is not defined in current scope”.
Can anyone help me understand what might be the issue here? Thank you.
(https://root.cern.ch/root/htmldoc/guides/primer/ROOTPrimerLetter.pdf)
My cpp code is attached. slit.cpp (714 Bytes)
Please read tips for efficient and successful posting and posting code
_ROOT Version: 5-34-38
Platform: Ubuntu
Compiler: Not Provided