Some questions

This is a discussion on Some questions within the C++ Programming forums, part of the General Programming Boards category; What does while(cin) mean? What about while(cin.good())? Is there a difference between c=cin.get() and cin.get(c)?...

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    65

    Some questions

    What does while(cin) mean? What about while(cin.good())?

    Is there a difference between c=cin.get() and cin.get(c)?

  2. #2
    coder
    Join Date
    Feb 2008
    Posts
    127
    I've personally never used something like while (cin)
    I guess it just checks whether the object cin exists.

    about good() :
    http://www.cplusplus.com/reference/i.../ios/good.html

    about get() :
    http://www.cplusplus.com/reference/i...tream/get.html

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,264
    I guess it just checks whether the object cin exists.
    No, it is (roughly) the same as cin.good().
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. questions....so many questions about random numbers....
    By face_master in forum C++ Programming
    Replies: 2
    Last Post: 07-30-2009, 09:47 AM
  2. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 06:36 AM
  3. Several Questions, main one is about protected memory
    By Tron 9000 in forum C Programming
    Replies: 3
    Last Post: 06-02-2005, 08:42 AM
  4. Trivial questions - what to do?
    By Aerie in forum A Brief History of Cprogramming.com
    Replies: 23
    Last Post: 12-26-2004, 09:44 AM
  5. questions questions questions.....
    By mfc2themax in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-14-2001, 08:22 AM

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