Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4020938
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:17:24+00:00 2026-05-20T10:17:24+00:00

I am learning C and have some issues. Please, take a look at the

  • 0

I am learning C and have some issues. Please, take a look at the picture below:

enter image description here

When reading the highlight text, I am quite confused. Is it that: when the user starts entering some inputs, the input is put directly and immediately in the buffer. And when Enter key is hit (‘\n’), the program reads and gets input from the buffer and then clear the buffer?

If it is, suppose in the program, I use: scanf("%d", &a_variable) and then I enter 123astring, then 123 is read and clear from the buffer.So, In the buffer now contains “astring“?

Am I right? Or I am misunderstanding something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:17:25+00:00Added an answer on May 20, 2026 at 10:17 am

    There really are two buffers.
    The first is the one they are talking about. It allows the user to type in stuff, then delete, etc. without the program ever seeing any of it.
    The second buffer is what would be holding the remaining “astring”.

    A good way to think of it is the first buffer passes to the second buffer when Enter is pressed. The second buffer is read by scanf. And if it is empty, the program waits.

    The second buffer is pretty much always there. If it wasn’t, you would have to be running scanf exactly when the user typed which is not true even in the ‘unbuffered’ case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started using/learning Python and have some questions. I have a text file
i have done some learning on struts based on one project that i got.Now
Ok I am still having some issues with this code below. I have received
I recently started learning about IPC and I have some issues. I wrote a
I am learning Java with Swing and I have some problems with using JTextField
I'm hacking my way through learning Flex and have found some strange behaviour. When
I am learning JPA from this tutorial . I have some confusions in understanding
im currently learning python (in the very begining), so I still have some doubts
I'm learning about SNMP, and writing some applications using it. I have some basic
I am learning Ruby and have to do some homework, but have problem with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.