DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
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.


Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links