I created a program called test:
#include<stdlib.h>
#include<iostream>
int main()
{
std::cout<<system("..\\add\\debug\\add.exe 4 8");
while(true);
return 0;
}
add.exe consists of
#include<stdlib.h>
int main(int argc,char **argv[])
{
int n=((unsigned)argv[1]);
int m=((unsigned)argv[2]);
return(n+m);
}
so when I run test, I get
6841420
The attempt was to have test run add with parameters 4 and 8, and for add to return the sum of those values (12) and then test would display that to the screen. How did I get 6841420, and how can I fix it?