Click here to Skip to main content
15,887,875 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to create a c++ console application judge system in C# for myself and a few friends. The user should select a cpp file, a folder with tests(an input file and an output file). The program should compile the cpp file(the user should have gcc compiler installed), execute it for every test and evaluate whether the output given by the user's program is the same as the output file for that test. I know how to do most of the stuff for the program, but I don't know how to compile the cpp file. I would be really grateful if anyone helps.

What I have tried:

I have tried searching everywhere how to do this, I even tried looking at other judge systems but I couldn't find what I was looking for.
Posted
Updated 11-May-18 9:19am

1 solution

Use the Process class to execute gcc: Process Class (System.Diagnostics)[^]

Be aware: if you "randomly" run applications you are given as source, you are opening your whole machine up to whatever the app writer chooses to do. I would STRONGLY recommend that you look at using a VM if you value anything else on the computer...
 
Share this answer
 
Comments
Member 13823039 11-May-18 15:59pm    
Thanks a lot for the answer, I'm going to try it. Also I forgot to mention I intend to make a local program that someone can download and run on their machine.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900