using write function in C and this can write chars to screen ?
https://stackoverflow.com/questions/37822580/why-is-it-possible-to-write-to-stdin A quick search on Google would answer most of your questions
i found that one , i didn't understood it very well
Give me some time. I will explain that a little more clearly; though I still think that SO answer does explain it well.
You have to understand a bit of history on serial devices to be able to understand what the answer in SO is saying. In olden days, when you needed to use a computer (typically a mainframe computer) located away from the place you would be sitting at, you used to have a terminal device (a keyboard and a monitor). This communication was done using serial communication (this was preferred over a parallel communication because of the ease of implementation and cost savings. It saved on the number of wires used for communication). The serial communication required setting of things like baud rate (how many bits are sent every second), whether the communication channel was duplex or simplex (imem whether there can be communication from either end at the same time or whether it was always one at a time), agree on start bits (the bits used to indicate when data transfer is to begin from an idle channel) and stop bits (bits used to indicate when a data transfer has ended and that the channel is transitioning to idle state) and so on. During those days, most communication was one way that only the terminal device or the mainframe could be communicating at any point of time. Because of this, the serial devices were configured to support both input and output at the same time, rather than having two different channels (one configured for input and the other configured for output). Since a device could only be either transmitting data or receiving data at any point of time (because of hardware restrictions), opening them for both input and output at the same time was not a problem. So the kernel would typically open a channel for both input and output and then duplicate these channels as input stream, output stream and error stream and pass them on to login and shell. This behavior has been replicated in modern kernels for compatibility reasons and hence you can write to stdin which would then echo the characters on to the terminal device. In modern kernels, if you redirect the stdin to a regular file, output will fail however. The compatibility is retained only when input is pointed to a terminal or a terminal emulator.
Your question is my answer to something lol
Обсуждают сегодня