Write the values to a file from your program.
ofstream outs( "data.txt" );
outs << value1 << "\n" << value2 << std::endl;
Choice of shell matters. Here I usebash and awk.
value1=`awk 'NR==1' data.txt`
value2=`awk 'NR==2' data.txt`
If you want to avoid the file on disk, you can always write tostd::cout and pipe the result into awk. Etc.
Hope this helps.
Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229