stdin
is of type FILE *
,
is there a fd
macro for it?
Or do I need to convert it myself?
stdin
is of type FILE *
,
is there a fd
macro for it?
Or do I need to convert it myself?
The following are the integer file descriptors for the standard streams:
stdin
stdout
stderr
#include<unistd.h>
#include<stdlib.h>
int main(){
char ch;
read(STDIN_FILENO,&ch,1);
write(STDOUT_FILENO,&ch,1);
exit(EXIT_SUCCESS);
}
© 2022 - 2025 — McMap. All rights reserved.
stdin <==> 0
;stdout <==> 1
;stderr <==> 2
– Bathypelagic