inkey()


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: inkey()

  1. #1
    Craig Guest

    inkey()


    could anyone help me with the inkey() function within c++? i would just like
    to know the parameters allowed and this is my problem...

    i need to find the end of an entered formula.
    basically find the enter(*pressed) at the end.
    i believe it is like this inkey(32) but i'm not sure
    my code would be:
    do{
    } while(inkey(32));

    could i also use this:
    *replacing just after the while...

    (cin >> in[count1]) != ascii(32)
    not sure what it is...kinda rusty in the input areas.

    thanks for any help given.

  2. #2
    Danny Kalev Guest

    Re: inkey()

    inkey() is not a standard C++ function. I don't see any advantage in
    using this function instead of getch(), and then cheking the result to
    see if it doesn't equal '\n'. It's more readable and maintainable than
    using hardcoded ASCII values.

    Danny

    Craig wrote:
    >
    > could anyone help me with the inkey() function within c++? i would just like
    > to know the parameters allowed and this is my problem...
    >
    > i need to find the end of an entered formula.
    > basically find the enter(*pressed) at the end.
    > i believe it is like this inkey(32) but i'm not sure
    > my code would be:
    > do{
    > } while(inkey(32));
    >
    > could i also use this:
    > *replacing just after the while...
    >
    > (cin >> in[count1]) != ascii(32)
    > not sure what it is...kinda rusty in the input areas.
    >
    > thanks for any help given.


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