Thread: cin.get() aint working.

  1. #16
    VA National Guard The Brain's Avatar
    Join Date
    May 2004
    Manassas, VA USA
    getch( ) is a cool function.. however, it is not good practice. It is part of the non-standard <conio.h> library.. which makes it non-standard and non-portable.

    But if you are not worried about portability or compliance with C++ ISO standards, then getch( ) is quick and easy and it's pretty cool. Mainly because it saves you the trouble of trying to come up with your own version of getch( ) which would be wicked hard.
    • "Problem Solving C++, The Object of Programming" -Walter Savitch
    • "Data Structures and Other Objects using C++" -Walter Savitch
    • "Assembly Language for Intel-Based Computers" -Kip Irvine
    • "Programming Windows, 5th edition" -Charles Petzold
    • "Visual C++ MFC Programming by Example" -John E. Swanke
    • "Network Programming Windows" -Jones/Ohlund
    • "Sams Teach Yourself Game Programming in 24 Hours" -Michael Morrison
    • "Mathmatics for 3D Game Programming & Computer Graphics" -Eric Lengyel

  2. #17
    Registered User
    Join Date
    Jan 2005

    Lightbulb um...

    ...try adding another cin.get(); at the ent of the file (before the "}" of course) and it chould work. i think.

  3. #18
    Registered User
    Join Date
    Jan 2005
    just add a cin.get(); before the }

  4. #19
    Registered User
    Join Date
    Jan 2005
    oops. im new at this...

  5. #20
    Super Moderator
    Join Date
    Sep 2001
    ... if you click on the edit button you can delete your posts...

    Try to avoid posting in threads that haven't changed in a week. The board moves fast, so you can rest assured that after a few days the problem is usually solved.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Trying to eject D drive using code, but not working... :(
    By snowfrog in forum C++ Programming
    Replies: 3
    Last Post: 05-07-2005, 07:47 PM
  2. cin.get(); doesn't seem to be working as expected
    By Diablo84 in forum C++ Programming
    Replies: 5
    Last Post: 03-30-2005, 06:00 PM
  3. x on upper right corner not working
    By caduardo21 in forum Windows Programming
    Replies: 1
    Last Post: 02-20-2005, 07:35 PM
  4. Problems using while loop with cin.get()
    By Arooj in forum C++ Programming
    Replies: 4
    Last Post: 11-28-2004, 12:58 AM
  5. cygwin -> unix , my code not working properly ;(
    By CyC|OpS in forum C Programming
    Replies: 4
    Last Post: 05-18-2002, 04:08 AM