Writingad strings from parent process into the stdin of child process
Вопрос
I am trying to write two strings 'username' and 'passwd' into my child process as stdin, and run 'checker' to varify the username/passwd combo and return a value back to the parent process. Somehow my code doesn't work because "the checker program could not read from stdin" How should I fix this?
pid_t pid;
int status;
int fd[2];
pid = fork();
if ((pipe(fd)) ==-1){
perror("pipe");
exit(1);
}
Нет правильного решения
Не связан с StackOverflow