What is system() in c++? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What is system() in c++?

How to use it?

22nd May 2017, 1:34 PM
Mark Anohin
Mark Anohin - avatar
3 Answers
+ 6
It calls the systems command processor. You can execute pretty much anything that is executable with it. Do not get into the habit of using it. It is terrible for security. See here: http://www.cplusplus.com/forum/articles/11153/ Basically. You can never be sure what you are really executing. Is pause really pause? Is it even available? Is it a virus? How can you be sure?
22nd May 2017, 2:11 PM
jay
jay - avatar
0
system("cd /path/to/myFolder"); As an example, this will move the current command line folder into that path.
22nd May 2017, 3:41 PM
Testing002
- 2
attribute
22nd May 2017, 1:50 PM
Rahul Siloniya
Rahul Siloniya - avatar