I would like to evaluate in org mode source code blocks in C++ containing "cin" instructions but I can't find a way to have an interactive evaluation (with user input) during evaluation. Example of code :
#+BEGIN_SRC C++ :results output :export code :tangle myfile.cpp
#include <iostream>
using namespace std;
int main()
{
int a;
cin>>a;
cout<<a+1;
}
#+END_SRC
Is it possible to have such an interactive evaluation or to simulate (by giving to the source code a fake input) ?
:var varname=value
in the header. In the second case you could still use:var
, but in place of value use another code block with an ELisp function which asks for input.