I was just experimenting with idea's and i wrote a program
to check what another program returns.
such as if it ran successful my program would display a 0,
because that what the program main() would return.
anyways this is the code :
and this is the code of the program i checkedCode:#include <iostream> #include <process.h> using namespace std; int main() { int check; check = system("\"D:\\Documents\\Visual C++ Projects\\variablework\\Debug\\variablework.exe\""); cout << check << endl; cin.get(); return 0; }
Now my question is, when i run the first program and it runs theCode:#include <iostream> using namespace std; int main() { cout << "poop" << endl; return 156; }
2nd program it displays the return amount in my program like it
should, but it also displays the word i set in the cout statment of
the 2nd program. This doesnt seem normal to me. Any insight is
appreciated.