Linux terminal does not display back

Source: Internet
Author: User
Linux terminal does not display back-Linux general technology-Linux programming and kernel information. The following is a detailed description. From: Lake Building

I 've been trying to write a program segment and try to input something that doesn't show back, but I 've been getting stuck with some things (I'm actually lazy and playing games) until recently I have to add something to the company's code.

As a result, after a round of google, I finally found the answer because I was dizzy when I saw APUE. The code is very simple. First Use tcgetattr to get the existing attributes, and then set XXX. c_lflag & = ~ on the existing attributes ~ ECHO, and then use tcsetattr to set the new attributes. for functions related to two terminals, fd must be provided, which is 0 for stdin, I don't know why I couldn't write stdin directly yesterday. below, I have it.

PS: Is it better to paste the code? So we have the following:
QUOTE:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.