I want to make a site with multiple C++ exercises – I have no idea how to write the code for a compiler, so I ended up deciding on the GCC compiler (version 14.1).
How I see the site working: the user types their solution in a textarea and click submit. The compiler then compiles the code with text cases (which are stored in an array) and checks if the result outputted is equal with the one stored on the server.
All I have is a way of getting the text from the textarea, and pass it down to a function as a parameter, and the text cases, stored in an array. Now I need to write the function so that the compiler compiles the code. All written in JavaScript. How can I achieve this, if possible?
Cotenescu Tudor Iosif is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.