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

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.

13th Aug 2020, 2:12 AM
Mr-Powerful - avatar
4 ответов
+ 4
Have you tried "system"? More detail and examples are at:,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.
13th Aug 2020, 3:17 AM
Josh Greig
Josh Greig - avatar
+ 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() 👇
13th Aug 2020, 3:19 AM
Arsenic - avatar
13th Aug 2020, 6:43 AM
Ockert van Schalkwyk
Ockert van Schalkwyk - avatar
I think system pause is like this
13th Aug 2020, 3:20 AM
Mr-Powerful - avatar