Okay, let's say that I have b.exe, which takes a string argument. I want to invoke b.exe within a.cpp, with system:
string s1 = "hallo";
system("b.exe s1");
printf("s1 after invoke = %s",s1);
and this is the code in b.cpp:
int main(string s)
{
s = "hello world";
return 0;
}
what I want is, when I run a.exe, the output will be:
s1 after invoke = hello world
is it possible to do that? basically, i just want to pass a variable to an exe, but it must be by reference, not only by value because I want that variable to be processed and modified within the exe that I invoked. I've already searched the solution on the internet, but it only provides me tha way to pass a variable by value to the exe, not by reference..
any suggestion will be very appreciated, but if possible, I want the suggestion in the form of the above correction code and include files, if any. thanks for your help :)