So schreiben Sie über seinen Dateideskriptor in ein interaktives ProgrammLinux

Linux verstehen
Anonymous
 So schreiben Sie über seinen Dateideskriptor in ein interaktives Programm

Post by Anonymous »

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

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post