Thread: Clearing the input buffer which doesn't have a newline

  1. #46
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Nwb
    219 of the ASCII table is AN ASCII character
    I suppose you could criticise it as being rather pedantic, but actually, there is no ASCII character with a value of 219. Strictly speaking, the ASCII table only has 128 entries, from 0 to 127.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  2. #47
    Registered User
    Join Date
    Sep 2018
    Posts
    217
    Quote Originally Posted by laserlight View Post
    I suppose you could criticise it as being rather pedantic, but actually, there is no ASCII character with a value of 219. Strictly speaking, the ASCII table only has 128 entries, from 0 to 127.
    8bit ASCII has 256 values, so what are the rest of the characters?

  3. #48
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > 8bit ASCII has 256 values, so what are the rest of the characters?
    Dependent on what your environment chooses to do with them.
    Category:DOS code pages - Wikipedia
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #49
    Registered User
    Join Date
    Sep 2018
    Posts
    217
    Quote Originally Posted by Salem View Post
    > 8bit ASCII has 256 values, so what are the rest of the characters?
    Dependent on what your environment chooses to do with them.
    CategoryOS code pages - Wikipedia
    So they're not common for all environments is what you're saying? Thanks.

  5. #50
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Nwb
    There's difference between having to add files and not having to add files.
    What that means is that you have discovered that neither the C++ standard library nor the version of the conio library available to you provides the functionality to "check for 'key down events'". Saying that "C++ cannot check for 'key down events' without using some library or win api" is technically true, but it has different implications. For example, did you know that you cannot use C++ to perform any I/O without using some library? Yes, the C++ core language has no support for I/O, so that is true. You would use the standard library, or some OS library like the Windows API or POSIX functions, or some other I/O library that builds upon these or is specific to a freestanding implementation.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #51
    Registered User
    Join Date
    Sep 2018
    Posts
    217
    I see. I really think there's no point in criticizing somebody's post if you're not going to tell them what your criticism even is. I would have never known what Jim was trying to tell if it weren't for you guys, Salem and laserlight.

    And now Jim will quote this post and tell "not my bad you don't know anything". I know how this works now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using getchar() to flush newline from input buffer
    By Valour549 in forum C Programming
    Replies: 15
    Last Post: 11-03-2018, 07:49 AM
  2. Clearing c++ input buffer
    By mramazing in forum C++ Programming
    Replies: 4
    Last Post: 11-08-2007, 11:05 AM
  3. clearing the buffer - but not the newline
    By Ash1981 in forum C Programming
    Replies: 13
    Last Post: 01-06-2006, 05:22 AM
  4. Clearing the input buffer
    By caduardo21 in forum C Programming
    Replies: 1
    Last Post: 05-14-2005, 08:40 PM
  5. Clearing the Input buffer
    By Brain Cell in forum C Programming
    Replies: 5
    Last Post: 03-21-2004, 12:08 PM

Tags for this Thread