I'm using ubuntu 12.04 and i need to exchange an int variable from a cpp program to another. program A.cpp has to work with an int variable,but the value of this int variable has to be define in program B.cpp
In a very simple example:
B.cpp:
int x=0;
cout<<"define x\t";
cin>>x;
A.cpp:
int y=0;
y=x+5;
cout<<y;
A.cpp and B.cpp are two different cpp programs and variable x should not to be static,after i execute A.cpp i have to change x value without exit from the execution
How can i do this?