c++ software passing arguments method

I have a problem related to passing arguments to a C++ compiled executable. The program emulate the behaviour of a particular inference engine: the setup of the engine is load at runtime from an XML file, and then I want to call it from command line with different input values. The characteristic of the input are:

  • Every time that I call the program, the input structure is different, because the system itself is different.
  • The input is a set of couple {name, value}, one for each part of the system.
  • I have to separate the configuration XML from the input.
  • I call the program from a PHP or Node.js server, since it return a result that I expose to the outside through an API.
  • Input value are obtained from an HTTP post request.

By now I have tried these solutions:

  1. Pass it from the command line ex: "./mysoftware input1 value1 input2 value2 ...etc". A little unconfortable, since I have up to 200 input.
  2. Create a file with all the couples name,value and then call the program that parse the file and then destroy at the end. This is a bottleneck of performance for my API, because at every call I have to create and destruct a file.

Does anyone know a better way to approach this problem?

3. Pass the values to the program via the standard input stream and read them from std::cin inside your C++ program.