Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 21:03

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



ENTER Abfrage

Discussion on ENTER Abfrage within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2012
Posts: 191
Received Thanks: 34
ENTER Abfrage

Hey Leute,

ich möchte fragen wie man abfragen kann ob der benutzer die Taste ENTER gedrückt hat, hier ist der Code:

Code:
int main()
{  
     system ("CLS");
    char w;
    //Menü
    cout << "-----------------" << endl;
    cout << "-Du vs. Computer-" << endl;
    cout << "-----------------" << endl;
    cout << "                 " << endl;
    cout << "                 " << endl;
    cout << " Du vs. Freund   " << endl;
    cout << "                 " << endl;
    w=getch();
    if (w=='w')
    {
      Menuw();
    }
     if (w=='W')
    {
      Menuw();
    }
    if (w=='s')
    {
      Menuw();
    }
    if (w=='S')
    {
      Menuw();
    }
    [COLOR="Red"]if (w==??ENTER??)
   {
     ZSGLT();
   }[/COLOR]
        

}







Habs doch geschafft :

Code:
#define VK_RETURN 0x0D
//Programm
if (w==VK_RETURN)
{
//Doing
}

[Pro]grammierer is offline  
Old 06/14/2012, 18:16   #2
 
xNopex's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 827
Received Thanks: 471
'\n' müsste es sein
xNopex is offline  
Old 06/14/2012, 18:20   #3
 
elite*gold: 0
Join Date: Jun 2012
Posts: 191
Received Thanks: 34
Deine Variante klappt bei mir nicht.
Muss man das irgendwelche Header-Dateien einbinden?
Aber egal hab's ja mit VK_RETURN geschafft.
[Pro]grammierer is offline  
Old 06/14/2012, 18:28   #4
 
elite*gold: 5
Join Date: Sep 2006
Posts: 385
Received Thanks: 218
Spontan würde ich das mit lösen.
Nightblizard is offline  
Old 06/14/2012, 18:49   #5
 
Dr. Coxxy's Avatar
 
elite*gold: 0
Join Date: Feb 2011
Posts: 1,206
Received Thanks: 736
ascii code für ENTER ist 13.

Code:
if (w == 13)
aka carriage return '\r'
Dr. Coxxy is offline  
Old 06/14/2012, 18:53   #6
 
elite*gold: 0
Join Date: Jun 2012
Posts: 191
Received Thanks: 34
@Dr. Coxxy Hatte ich schon davor probiert und ging nicht

Aber egal ich habs gelöst kann geclosed werden
[Pro]grammierer is offline  
Reply


Similar Threads Similar Threads
[C#] webBrowser Url Abfrage
08/18/2011 - .NET Languages - 0 Replies
Edit: Nach 2 Stunden rumprobieren hab ichs jetzt doch noch geschafft :)
bot abfrage
04/08/2011 - Ragnarok Online - 4 Replies
hallo ich habe beim server wo ich bin wenn man da in iein dun is eine botabfrage dann kommt ein bild man muss die zahl eingeben und dann kann man weiter machen wenn ich es aber mit openkore machen wie soll das gehen danke für die hilfe
Abfrage in dec?
12/02/2010 - General Coding - 7 Replies
Hallo Leute, ich habe mir hier schnell ein kleines Programm zum üben geschrieben und hab nun eine Frage. Der Code sieht so aus: /* Autor: ****** E-mail: ****** Datum: 28.11.2010 Programm: Check if letter is uppercase or not
If abfrage
12/29/2009 - AutoIt - 8 Replies
Hallo leute. Wollt ma fragen ob mir jemand sagen könnte wie ich abfragen kan ob in einer input box z.b steht xD und dan in der if abfrage so abfragen könnte wen dort xD steht das er z.b das script schliest weis das einer?



All times are GMT +1. The time now is 21:03.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.