system() plays a very special role in executing Operating System Commands.
By using this library function we can run all those terminal commands that our Operating System allows us to perform, just by using our C program.
Same output as you get on writing ipconfig in Windows or ifconfig in Linux on your terminal. You are just using ipconfig/ifconfig on terminal but using C code isn't it cool.
Now we are looking at a code to ShutDown your system.
An alert box appears telling you that your System will Shut Down.
Run these codes on your System and have fun. 🙂
This article is contributed by Mohit Gupta_OMG 🙂. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- system() in C/C++
- Timer in C++ using system calls
- Wait System Call in C
- Accept system call
- C/C++ program to shutdown a system
- pipe() System call
- Print system time in C++ (3 different ways)
- dup() and dup2() Linux system call
- Input-output system calls in C | Create, Open, Close, Read, Write
- cin get() in C++ with Examples
- Difference between Increment and Decrement Operators
- Map of Vectors in C++ STL with Examples
- Problem in comparing Floating point numbers and how to compare them correctly?
- exit(0) vs exit(1) in C/C++ with Examples