2
$\begingroup$

I have a requirement for executing a C program within Mathematica. The user will provide the inputs and the expected results on a front end. Mathematica runs the C file, obtains the result for the provided inputs and compares with the user provided expected results. Further, a green pass button will be displayed if the results matched else a red failed button will be displayed. Later, I want to be able to do the same for C++, Python, Java, and Perl programs. Anyone has worked on this before ?

Warm regards, Anuk

$\endgroup$
2
0
$\begingroup$

If you want to run an executable from within Mathematica, and read in the results, you can use the following syntax:

Import["!executablename", "someformat"]

The "!" indicates that the program will be run and the output read. Choose the appropriate format in Import. You can also use "!" with other input functions, such as ReadList.

For tighter integration with C, the answers here are exhaustive:

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.