stdin and stdout can be read from and written to using System.in and System.out so I wouldn't bother trying to do this in native code.
The executable file will be called from an external program, that will communicate with it through stdin/out, so I haven't the option to use System.out/in! To be specific, I'm going to write a UCI (universal chess interface) for my chess engine.
To write to stdout in C++ one uses "cout >> ..." isn't it? To read from it "cin", but when do I know when new data is available? How to convert to a Java string?
For a C++/JNI expert this should be piece of cake to answer. Please post some code. Thanks!