Using CMD commands in C++ | Sololearn: Learn to code for FREE!

0

Using CMD commands in C++

Which command I need to write to use CMD commands in C++ and which library I need to include. I want to create some gifts for my friends.

8/13/2020 2:12:02 AM

Mr-Powerful

4 Answers

New Answer

+4

Have you tried "system"? More detail and examples are at: https://www.tutorialspoint.com/system-function-in-c-cplusplus#:~:text=The%20system%28%29%20function%20is%20a%20part%20of%20the,returns%20the%20command%20after%20it%20has%20been%20completed. In Unix and probably linux also, there are some functions for c programs that give you more control over the running program. Functions like fork, exec, and pipe can help you redirect standard input, output, and standard error of the other process.

+2

You can make use of system() function to pass an command to comand line if the OS allows. Go here to learn more about system() 👇 https://www.geeksforgeeks.org/system-call-in-c/

+1

C++ Demonstration: https://code.sololearn.com/cJEm3FJ5m3vi/#cpp

0

I think system pause is like this