Total beginner here, so please be gentle. I have a example.cpp file which has one main function which accepts some input parameters and returns an integer value.
How would I run this .cpp file from within Python such that I can specify the input parameters from within Python and access the output of the .cpp so that it is stored in Python?
Thanks
I've modified the main function to accept command line input. What do you mean by "returns its result as its exit code", kindall?
Also, want to add that I'd want to return a vector created from the .cpp so that the variable is in Python
You can't run a .cpp file, as you need to compile a binary from your .cpp file before you can execute it. first, try to compile it using your terminal, after that you might port it to python, and automate it in a Python script (I guess, that's why you want to do it in Python).
Python/C++: Running .cpp in Python