cin.get() aint working.

This is a discussion on cin.get() aint working. within the C++ Programming forums, part of the General Programming Boards category; getch( ) is a cool function.. however, it is not good practice. It is part of the non-standard <conio.h> library.. ...

  1. #16
    VA National Guard The Brain's Avatar
    Join Date
    May 2004
    Location
    Manassas, VA USA
    Posts
    903
    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
    Posts
    25

    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
    Posts
    25
    just add a cin.get(); before the }

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

  5. #20
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    ... 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.

Page 2 of 2 FirstFirst 12
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, 08: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, 07:00 PM
  3. x on upper right corner not working
    By caduardo21 in forum Windows Programming
    Replies: 1
    Last Post: 02-20-2005, 08:35 PM
  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. cygwin -> unix , my code not working properly ;(
    By CyC|OpS in forum C Programming
    Replies: 4
    Last Post: 05-18-2002, 05:08 AM

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