Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Easy C++ question

  • 08-03-2005 03:19PM
    #1
    Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭


    I'm new to C++,but I've been using C for ages. I'm writing a console app and was wondering if there was any way to use unbuffered input without having to use the getch() from conio.h?


Comments

  • Registered Users, Registered Users 2 Posts: 2,281 ✭✭✭DeadBankClerk


    istream& get (char& c );
    istream& get (char* s, streamsize n );
    istream& get (char* s, streamsize n, char delim );
    istream& get (streambuf& sb);
    istream& get (streambuf& sb, char delim );


    cin.get(c)


  • Registered Users, Registered Users 2 Posts: 4,003 ✭✭✭rsynnott


    istream& get (char& c );
    istream& get (char* s, streamsize n );
    istream& get (char* s, streamsize n, char delim );
    istream& get (streambuf& sb);
    istream& get (streambuf& sb, char delim );


    cin.get(c)

    Erm, they're buffered, aren't they?


  • Closed Accounts Posts: 8 z00m


    Don't you really know the methods?
    int getc() / int fgetc(FILE*) - returns input character
    char * gets / char* fgets(FILE*) - returns input string


Advertisement