My cpp source code:
#include <iostream>
using namespace std;
int main(int argc, char **argv) {
cout<<"Before"<<endl;
system("Rscript /Desktop/R_TENS/rtest.R");
return 0;
}
rtest.R
rtest = function(input ,output){
a <- input
b<- output
outpath<-a*b
print(a*b)
return(outpath)
}
Compile: g++ name.cpp
This creates a executable file. But how the parameters (eg:2,3) is could be passed?
./a.out 2 3
is not working. Expected result for this input is 6.