I have a java application I need to pass some info to a C++ program. It has been suggested that I use some simple socket programming to do this. Is this the best way? If not
A simple way to do this is using standard input and output:
class MyTest {
public static void main(String... args) {
System.out.println("carpet");
}
} // Java
#include
#include
int main() {
string input;
std::getline(std::cin, input);
std::cout << "from java: " << input << std::endl; // output: carpet
} // C++
# start by piping java's output to c++'s input
$ java MyTest | ./my_receive