what's wrong with this c++ code, help!!!

This is a discussion on what's wrong with this c++ code, help!!! within the C++ Programming forums, part of the General Programming Boards category; Wow...this is interesting: Code: cin.ignore(cin.rdbuf()->in_avail()+1); What in the world does that do?...

  1. #16
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,399
    Wow...this is interesting:
    Code:
    cin.ignore(cin.rdbuf()->in_avail()+1);
    What in the world does that do?
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  2. #17
    Registered User lsctt's Avatar
    Join Date
    Jun 2006
    Posts
    30
    problem solved thanks...

  3. #18
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    It's a funny little 'look what I can do trick' that seems to come around some times. I think it will pause the program until it reads a line, and discard all the input that was on that line.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. what is wrong in this simple code
    By vikingcarioca in forum C Programming
    Replies: 4
    Last Post: 04-23-2009, 07:10 AM
  2. what is wrong with this code please
    By korbitz in forum Windows Programming
    Replies: 3
    Last Post: 03-05-2004, 09:11 AM
  3. I cant find what is wrong with this code
    By senegene in forum C Programming
    Replies: 1
    Last Post: 11-12-2002, 05:32 PM
  4. Anyone see what is wrong with this code?
    By Wise1 in forum C Programming
    Replies: 2
    Last Post: 02-13-2002, 01:01 PM
  5. very simple code, please check to see whats wrong
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 10-10-2001, 12:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21