Hi, root experts
I would like to run the following script mycpp.C inside root
#include <iostream>
#include <string>
#include <vector>
#include <bitset>
#include <cstring>
#include <stdexcept>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
using std::bitset;
using std::vector;
using std::cin;
using std::endl;
using std::cout;
using std::string;
using std::overflow_error;
int main(int argc,char **argv)
{
if(argc!=3)
{
cout<<"Please use 3 parameters"<<endl;
return -1;
}
cout<<"Their sum is: "<<atof(argv[1])+atof(argv[2])<<endl;
return 0;
}
Outside root, it is easy to run the code:
g++ myfun.C -o myfun
./myfun 1 2
The sum is 3
But I do not know how to run it inside root.
Could sb. give me some hints?
Cheers
Wenchao