Home  >  Q&A  >  body text

C程序输出结果后进入死循环,怎么用java读取它的输出结果

使用java调用exe程序,因为exe输出结果后程序没有结束,一直在运行,所以当在readline的时候会卡住,不能进入那个循环里面,有没有办法可以解决这个问题

PHP中文网PHP中文网2711 days ago369

reply all(2)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-18 09:54:21

    You can use pipes directly, cprogram.exe | java your_module

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 09:54:21

    For this simple value transfer, use a file. C and C++ also share memory. Java has never been exposed to it

    reply
    0
  • Cancelreply