Hi Guys

I need to compile and run a c++ program from java using

Process a = Runtime.getRuntime().exec ("g++ -g function.cpp -o function");
Process b = Runtime.getRuntime().exec ("./function");

the problem is that the output I get from the c++ program is not correct but If I compile and run it myself in the command line it works just fine. The problem is Java and i dont know why.

Thanks a lot

Al,

Hard to tell without more information.

Perhaps there is a bug in your code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.