I want to open multiple terminals when I run my code on Dev C++. I want to show different outputs on different terminals. On one terminal I want to show the activity log of whatever is happening in the code, and the other terminal should show the result I have generated.
When you program is executed it is a process.
If you want two consoles, you need two process, that is two programs. Moreover, they have to be able to comunicate
The first is relatively simple, it only print to screen whatever he receives as input.
On the other hand, the second has to
This article is quite detailed on how to do this https://learn.microsoft.com/en-us/windows/win32/procthread/creating-a-child-process-with-redirected-input-and-output (it says it is for C++ but it works also in C). Pay attention, to the "creation flags" you have to pass CREATE_NEW_CONSOLE
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With