Hi, -------- file text.cc void test(double toto) { toto = 2*toto; printf( "toto = %g\n", toto ); } ------- root [3] .x test.cc++(10) Info in <TUnixSystem::ACLiC>: creating shared library /home/couet/roottest/./test_cc.so toto = 20 root [4] Cheers, Olivier On Thu, 1 Apr 2004, Nicolas Arnaud wrote: > > Hi rooters, > > I would like to compile and execute a macro which has one parameter set by the user. How > can I do that? > > Example: > -------- > > Below is a very simple macro test.cc I can run in ROOT with the command: > > .x test.cc++ > > How do I change the syntax of the ROOT instruction and of the macro to allow the user to > set the value of the variable toto interactively ? > > Thanks in advance, > > Nicolas > > ----------------------------------- > Macro test.cc > ----------------------------------- > > #ifndef __CINT__ > > #include <stdlib.h> > #include <stdio.h> > > > int test(); > > int main() > { > return test(); > } > > #endif > > int test() > { > double toto = 2.; > printf( "toto = %g\n", toto ); > > return( 0 ); > } > > -- Org: CERN - European Laboratory for Particle Physics. Mail: 1211 Geneve 23 - Switzerland Mailbox: J25910 E-Mail: Olivier.Couet@cern.ch Phone: +41 22 7676522 WWW: http://cern.ch/Olivier.Couet/ Fax: +41 22 7677155
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:07 MET