Re: [O] Capturing output from C/C++

2015-03-05 Thread John Kitchin
I think you need to tangle the file, compile it and run the executable in a shell block. Here is a Fortran example: http://kitchingroup.cheme.cmu.edu/blog/2014/02/04/Literate-programming-example-with-Fortran-and-org-mode/ I have done similar things with C, java, etc... before. I don't know of

Re: [O] Capturing output from C/C++

2015-03-05 Thread Thierry Banel
It might be due to the return 1; statement. Change it to return 0; and try again. Le 05/03/2015 17:27, Roger Mason a écrit : Hello, I have a short C++ program: #+BEGIN_SRC cpp :flags -lm :results output #include iostream #include fstream #include cmath // for ceil #include

[O] Capturing output from C/C++

2015-03-05 Thread Roger Mason
Hello, I have a short C++ program: #+BEGIN_SRC cpp :flags -lm :results output #include iostream #include fstream #include cmath// for ceil #include cstdlib // for atof double f (double fv, double o, int i) { return fv / 2.0 + (1.0 - o) * fv * i; } int num

Re: [O] Capturing output from C/C++

2015-03-05 Thread Nick Dokos
Roger Mason rma...@mun.ca writes: Hello, I have a short C++ program: #+BEGIN_SRC cpp :flags -lm :results output #include iostream #include fstream #include cmath // for ceil #include cstdlib// for atof double f (double fv, double o, int i) { return fv /