Thread: cin.get() Troubles

  1. #16
    Registered User
    Join Date
    May 2008
    Posts
    48
    He was asking to do something impossible, i have to find it , its in the first couple of pages in the problems or exercises of that book, using only cin>>(variable) to extract something which only cin.get() was capable of from input stream, its was a joke of a question.

  2. #17
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    There is nothing cin >> cannot read that cin.get can.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #18
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Hmm . . . I wouldn't make such a broad statement. What about if you used this version of istream::get()?
    Code:
    istream& get (char* s, streamsize n, char delim );
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #19
    Registered User
    Join Date
    May 2008
    Posts
    48
    this was for the introductory part of c++ , were cin and cout was just introduced, anyways like i said i emailed him and he said it was definitely a mistake

  5. #20
    Registered User
    Join Date
    May 2008
    Posts
    48
    Anyways i appreciate that answer, it definitely closed that page and let me move on , instead of sheer confusion, thx again

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. cin.get() curiosity
    By lilrayray in forum C++ Programming
    Replies: 3
    Last Post: 09-03-2006, 10:07 PM
  2. cin.get() problem
    By Cilius in forum C++ Programming
    Replies: 20
    Last Post: 07-28-2005, 05:32 PM
  3. cin.get();
    By swgh in forum C++ Programming
    Replies: 2
    Last Post: 06-29-2005, 07:51 AM
  4. Problems using while loop with cin.get()
    By Arooj in forum C++ Programming
    Replies: 4
    Last Post: 11-28-2004, 01:58 AM
  5. curiosity about cin.get() and cin.getline()
    By ssjnamek in forum C++ Programming
    Replies: 18
    Last Post: 11-30-2003, 01:26 AM