So schreiben Sie über seinen Dateideskriptor in ein interaktives Programm

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: So schreiben Sie über seinen Dateideskriptor in ein interaktives Programm

by Anonymous » 02 Feb 2025, 07:34

Ich habe ein interaktives Programm, das bis zur Eingabe '1' ist.

Code: Select all

#include 
#include 

int main() {
std::string input;

while (true) {
std::cout > input;

if (input == "1") {
break;
}

std::cout 
echo 5 > /proc/pid/fd/0
echo hello > /proc/pid/fd/0
echo "hey\n" > /proc/pid/fd/0
echo 'hi\xA0' > /proc/pid/fd/0
< /code>
Selbst wenn ich das Programmterminal als aktive Shell bringe, tut es nichts. In das Terminal selbst tippt?
Danke

Top