I am trying to understand system calls made in C ++ using a system ("some command"). here is the code
#include <iostream> #include <cstdlib> using namespace std; int main() { cout << "Hello "; system("./pause"); cout << "World"; cout << endl; return 0; }
an executable pause is created from the following code
#include <iostream> using namespace std; int main() { cout<<"enter any key to continue\n"; cin.get(); return 0; }
I get the following output
enter any key to continue 1 Hello World
Can someone explain the conclusion to me? I was expecting this -
Hello enter any key to continue 1 World
source share