I need to run this line from my c++ program:
java -jar test.jar text1 text2
the java app will give a float value and give it to the c++ program.
How
The easiest if You can modify your java code:
write the result to environment variable (pseudo code below):
solution 1. (Write directly to env. in java app.)
java:
...
setenv('ret', somefloatvalue);
...
exit..
c++:
system("java -jar test.jar text1 text2")
...
getenv("ret")
(I haven't test it, but important here is the context, does system creates another shell (console), if yes, you'll not see those envs, therefore some other spawn method is necessary)
CreateProcess() on windows fork() on linux.
There are also more complex solutions,