Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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

share|improve this question

marked as duplicate by Yves Klett, cormullion, Leonid Shifrin, m_goldberg, halirutan Mar 6 '13 at 13:49

This question was marked as an exact duplicate of an existing question.

MathLink is your friend. – Rolf Mertig Mar 6 '13 at 12:06
You can use .NET to load DLL in Mathematica… – user6227 Mar 6 '13 at 13:18

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:

share|improve this answer

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