in this link
http://www.cplusplus.com/articles/j3wTURfi/:
what does the word "resource heavy" mean ?
"it executes not just one, but maybe two separate processes and returns an exit status to your program"
why ? and how to know that it executes more than one process ?
"here is WaltP's simplified"
what does the word "WaltP" mean ??
"Because you have no guarantee that the program you are executing
1 is a valid command
2 does the same thing on all systems
3 hasn't been compromised with malicious code, or
4 is the program you think it is"
if I write the program myself so I know that it is valid and that it is not compromised and it is the program I think it is because I write it myself .
what does all this mean:
"
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__
"
for windows users we can use only this command to open the notepad :
#define EDITOR "notepad"
what does this mean:
"if you do need to use system(), it is generally a good idea to check that you have a shell available:
1 2
|
if (system( NULL )) then_I_can_safely_use_system();
else fooey();
|
"
what does this mean :
"Do not use system() from a program with set-user-ID or set-group-ID privileges, because strange values for some environment variables might be used to subvert system integrity. Use the exec(3) family of functions instead, but not execlp(3) or execvp(3). system() will not, in fact, work properly from programs with set-user-ID or set-group-ID privileges on systems on which /bin/sh is bash version 2, since bash 2 drops privileges on startup. (Debian uses a modified bash which does not do this when invoked as sh.)"
this link :
http://www.gidnetwork.com/b-61.html
explains the system("pause") and system() and how it takes 9 instructions in order for the program to be paused and then exited . May be this is the only disadvantage of the system() function . However, judging from the tutorial , I am not convinced at all that system() function is
dangerous