1

我想在我的应用程序中使用 Cling 作为嵌入式 c++ 解释器。目前它的设计目的是获取控制台输入并提供输出。如何更改它以嵌入 - 获取输入流并提供可在我的应用程序中使用的输出流?

4

1 回答 1

0
[cling$] .help
...
  .> <filename>     - Redirect command to a given file
  '>' or '1>'       - Redirects the stdout stream only
  '2>'          - Redirects the stderr stream only
  '&>' (or '2>&1')      - Redirects both stdout and stderr
  '>>'          - Appends to the given file

这就是重定向执行结果流的方式。

于 2014-08-03T14:03:16.573 回答