The system() is a standard C function. Platform independent.
http://www.cplusplus.com/reference/cstdlib/system/
The question is, why should our program run some another program?
Is that other program installed in every system, where our program is run? What if the system has a different program with same name earlier on the path? We would not be running the program we expect.
Running an another program implies that whatever the other program does, is required by our program. That implies communication. Passing information back and forth. Checking whether the other program succeeds.
That is all okay, if you do it for the right reasons and properly.
The problem are the blindly copied incantations:
1 2 3
|
using namespace std;
i++;
system( "pause" );
|
What are the urgent reasons that force our innocent program to depend on program "pause" (which is not available on every system)? Could we use C++ to imitate pause? What do we achieve with pause anyway? I have seen the 'pause' to be used in a MS-DOS batch script. That use was justified. There is no excuse to start pause from a C++ program.
Blindly copied.
"I have no idea what that line means, but every example has it, so I use it too." That is so wrong.
It is not bad to use system(), if you know what you are doing.
It is bad to do things without thinking and knowing.