(no subject)

From: Andrea Massironi <Andrea.Massironi_at_cern.ch>
Date: Tue, 14 Aug 2007 16:41:07 +0200


Dear Rooters,
I'd like to execute a Cint script contained in a string inside a file.cpp.

For example:

Proof.cpp

void Proof(){

    int a = 1;     

    std::string instruction;

    instruction = "a = 10; std::cout << std::endl << \"a inside = \" << a << std::endl;";

    gROOT->ProcessLine(instruction.c_str());

    std::cout << std::endl << "a outside = " << a << std::endl;

}

when I do

> .x Proof.cpp

I get

> Warning: Automatic variable a is allocated (tmpfile):1:

> a inside = 10

> a outside = 1

Is it possible to execute a cint script inside a file?

thanks Received on Tue Aug 14 2007 - 16:41:14 CEST

This archive was generated by hypermail 2.2.0 : Tue Aug 14 2007 - 23:50:02 CEST