I don't think there is any other way than command line arguments since the ways in which a program receives data are:
1. Standard input (keyboard in most cases)
2. File stream (reading data from files)
3. Command line arguments
Since you don't require 1 and 2, you obviously have to go with the third choice, that is command line arguments.
Now just a simple test:
1. Create a project "Driver" which willl contain a single file driver.cpp with contents:
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
int n1, n2;
// This program expects to get two numbers in argv.
// So the value of argc must be 3.
if( argc != 3)
{
printf("wrong number of arguments\n");
return 1;
}
n1 = atoi(argv[1]);
n2 = atoi(argv[2]);
cout << "The output in the driver program is " << n1 + n2 ;
return 0;
}
2. Compile the project so that the executable is created (driver.exe)
3. Create a project "Main" which will contain a single file main.cpp with the following contents:
#include <iostream>
int main()
{
system("driver 12 13") ;
return 0;
}
4. Make sure the project "Main" and "Driver" are in the same directory (just for our convinience) along with their executables.
5. Compile and Run the main.cpp and you will see the expected output. Try this and see if it works in your case.