Yahoo Clever wird am 4. Mai 2021 (Eastern Time, Zeitzone US-Ostküste) eingestellt. Ab dem 20. April 2021 (Eastern Time) ist die Website von Yahoo Clever nur noch im reinen Lesemodus verfügbar. Andere Yahoo Produkte oder Dienste oder Ihr Yahoo Account sind von diesen Änderungen nicht betroffen. Auf dieser Hilfeseite finden Sie weitere Informationen zur Einstellung von Yahoo Clever und dazu, wie Sie Ihre Daten herunterladen.
Is there a C++ equivalent of Java's Process.getOutputStream()?
Is there a way to get the stdin, stdout, and stderr streams of a process called by a C++ program, similar to Java's get*Stream() functions? I know about C++'s system(...) call but the only way I'm able to get the called process' output is by piping it to a file and then reading it back in, which is not an option in this case.
2 Antworten
- carlo.milanesiLv 5vor 1 JahrzehntBeste Antwort
There is no way to do that in standard C++, and it is not possible for preexisting processes.
You can do that using operating system specific system calls though, provided that it's your process that creates the other process.
For Microsoft Windows, see: http://msdn.microsoft.com/en-us/library/ms682499(V...
For POSIX systems (Unix, Linux, BSD, Mac OS), search for "popen".
May be there is a portable library that encapsulate several operating systems in a single API.