Possible Duplicate:
Issuing system commands in Linux from C, C++
I see on some text that it is not good to use system() call in linux programming, I wonder what are the real reasons of it? It should consume more memory and maybe more CPU. Apart from these what could be the reason?
For example, if I type system("echo 1 > file");
instead of using fopen(), fwrite()
what a hacker can do in my program/linux system? I saw that system() is not advise because of security issues. But how a person can hack a linux system just because of using system() call? I would be glad if someone can explain tangibly what could go bad to use system().