cin.get and getche()


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: cin.get and getche()

  1. #1
    Carl Guest

    cin.get and getche()


    Please advise what the cin.get and getche functions are doing in this
    part of the main.



    cout << "Continue[y/n] :" << endl; //added for vc++
    while(cin.get() != '\n');
    option = getche();

  2. #2
    Carl Guest

    Re: cin.get and getche()


    Thanks!

  3. #3
    Danny Kalev Guest

    Re: cin.get and getche()

    cin.get() reads a character from the keyboard. However, the user must
    press Enter to force cin to read the input. By contrast, getche() reads
    a keypress without waiting for the user to press Enter.

    Danny

    Carl wrote:
    >
    > Please advise what the cin.get and getche functions are doing in this
    > part of the main.
    >
    > cout << "Continue[y/n] :" << endl; //added for vc++
    > while(cin.get() != '\n');
    > option = getche();


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center