how to non-stop read the input character and without user press enter in console mode.

Discussion in 'C++' started by penny336, Jan 15, 2004.

  1. penny336

    penny336 Guest

    hi here is my original// it can convert to upper case or lower case but
    require user press "enter" how to implement a without "press enter" version
    e.g. if input 'a' --> at commad prompt will show 'A' immediately
    if read '(' it will end.

    int main()
    {
    char input;
    //char input1[1];
    cout<<"Please Enter As mush as you can:";
    do {
    cin.get(input);
    //cin.putback(input);
    if (isupper(input))
    cout.put(tolower(input));
    else
    cout.put(toupper(input));

    }while (input != '(');
    cout << endl; // ensure all output is displayed
    return 0;
    } // end main
     
    penny336, Jan 15, 2004
    #1
    1. Advertisements

  2. http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.17
     
    Simon Saunders, Jan 15, 2004
    #2
    1. Advertisements

  3. penny336

    penny336 Guest

    penny336, Jan 15, 2004
    #3
  4. Better. Learn to use the resources at your
    fingertips. It's all somwhere out there, you
    just need to find it.

    http://www.google.com

    for the search field enter: UNIX kbhit

    The first search result looks like a 100% hit.
     
    Karl Heinz Buchegger, Jan 15, 2004
    #4
  5. penny336

    osmium Guest

    And it only took two magic words! :)
     
    osmium, Jan 15, 2004
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.